Reputation: 1113
I've got a bunch of assemblies .dll in a folder. I open a project and add references to those files.
Et voila', Visual Studio copy those dlls into the output folder (Debug/Release/Whatever), change the references so that they point there and...keeps into the prj file the original path.
Result: I update one, some, all the dll, and Visual Studio cannot care less 'cause all it want to use is the local dll. And, to add to the magic, if I do a Rebuild (which does a Clean and then a Build), the references are not valid anymore 'cause the Clean removed the copied file.
Why it's working this way?
Upvotes: 0
Views: 109
Reputation: 1113
Ok, I randomly found the answer, it's just a matter of bad settings name.
First of all Visual Studio has an option "Copy Local": you may think that setting this to "No" will do the trick, but it does not work (which is obvious, after you try it) because if he doesn't copy the dll in the output folder then when the software run it doesn't find them (unless we are talking about assemblies in the GAC, but that's a different story).
In itself the problem is that Visual Studio should copy local from the original source and keep a reference to that, instead it copies once in the output folder and from that moment on it internally change the references to the output folder. It still keeps the original references into the prj file, but then it ignore them (so that if you Clean the project or the solution there are no more dll and it doesn't compile anymore)
The solution? The setting labelled as "Specific Version". Despite its name it does not enforce the use of the specific version of the DLL you referenced, it just tell to Visual Studio (coupled with Copy Local=Yes) the equivalent of "Copy Always".
Upvotes: 1