I’m using the Microsoft ASP.NET Web API in Visual Studio 2012 Windows 7 desktop app. I downloaded them from Nuget on 25th Jan 2013.
I’m manually referencing the DLLs in a project, however when adding a reference to the two files: System.Net.Http.dll and System.Net.Http.WebRequest.dll, visual studio seems to override this and take them from the folder C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Net.Http.dll and not the folder I specified C:\MyFolder\System.Net.Http.dll ?
I know this because I look at the Path in the Properties page for the files. All the other files work OK. This bothers me, because they are completely different file sizes, etc.
Why is this hapenning?
As a work-around, I suppose I can set the ‘Copy Local’ property to ‘True’ (it looks like the files are then copied from the .NET 4.5 Framework folder into my executable’s output folder), and then I can manually copy-replace them with the new ones from nuget, but this seems very long winded and still leaves me puzzled as to why I need to do this?
Can anyone assist?
The
System.Net.Httpassembly (and some others) are strongly named, meaning VS will always load it from GAC as long as it has the same version number as the reference.You can read more about the binding process here: http://msdn.microsoft.com/en-us/library/yx7xezcf.aspx