2

I'm developing a client application which connects with a web service, in order to do that I'm using the WebClient class and the JavaScriptSerializer class for parse the requested string as a JSON.

I had to add a reference from System.Web.Extensions.dll for make the second one work, and works great BUT if I move my exe file to other computer obviously will throw me the exception that it cannot find the dll. I tried to copy the System.Web.Extensions.dll to the bin folder of my app and add the reference again, but it seems that it's not working..

What I want to do is simple, I want to put the dll referenced with the path of my exe file and then all the time I migrate the file wherever I want the program loads the dll through the relative path..

Seriously, I don't know why Microsoft didn't make something easier to handle (such as the import of jar files in java) it's very confusing, same happened to me with the wiaaut.dll before and I had to register it in the system with regsvr..

4

2 回答 2

6

只要您将其复制到的机器具有完整版本的 .NET 就应该没问题 - 而不仅仅是客户端配置文件。您不需要复制任何内容 - 从 GAC 中提取它应该没问题。只需确保您拥有正确版本的 .NET。

于 2013-11-01T20:39:12.443 回答
0

您可以检查 System.Web.Extensions.dll 是否在目标机器的全局程序集缓存中。为此,只需打开 C:\Windows\Assembly 文件夹(这基本上是您的 GAC 文件夹)。如果不存在,则需要安装它。

要安装它,请使用以下命令:gacutil /i

更多关于 GacUtil 的信息:http: //msdn.microsoft.com/en-us/library/ex0ss12c.aspx

于 2013-11-01T21:09:04.977 回答