C# How does dll references work?

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..

Jon Skeet
people
quotationmark

It should be fine so long as the machine you're copying it to has the full version of .NET - not just a client profile. You shouldn't need to copy anything - it should just be fine to pull it from the GAC. Just make sure you've got the right version of .NET.

people

See more on this question at Stackoverflow