views:

863

answers:

2

I'm referencing a dll (ICSharpCode.SharpZipLib.dll) for my visual studio project from my bin folder, the version I want to use is 0.5.0.0. However, when I run the project, the dll gets replaced with a more recent 0.85.4.369 which is imcompatible with some of the libraries I've got.

How do I stop Visual Studio from doing an auto-update on the reference?

A: 

There is no auto-update. The later version must be in the GAC.

John Saunders
This isn't true. If VS does not find the assembly in the folder it expected to see it, then it starts searching the drive. It starts with the gac, then moves through the program files section, and finally it will start searching all your project folders. This has caused us a fair amount of pain due to the number of projects we have with different versions of third party assemblies.
Chris Lively
I don't believe this is the case. Can you find a citation about this? It uses the reference paths if you have them, but does not "search the drive".
John Saunders
+1  A: 

This is valid only for web sites - look in the bin folder of your project and check if there is a file there called ICSharpCode.SharpZipLib.dll.refresh. Delete it and VS will not look for new versions of the assembly when you build the site.

lingvomir