Visual-studio – How to stop a Visual Studio 2008 project compile from updating dependent web application projects

visual studiovisual-studio-2008

I just upgraded a solution from .NET 2/Visual Studio 2005 to .NET 3.5/Visual Studio 2008.

I have a Web Application Project "W" that has a project reference to a class library project "C".

When I build "W", "C" is compiled and copied local, and all is good.

However, if I make a change to C, or build C with a different configuration, and compile ONLY C, the output is automatically copied to W's \bin directory! And in my case, this breaks W.

This behaviour seems to be specific to VS2K8 and web application projects. I'm sure someone thought it would be nice to have studio push updates forward to referencing projects, but it's a very bad idea.

Is there a way I can turn this behaviour off? I can't find a related project or IDE option anywhere.

Best Answer

Create a file called "Libraries" or something else appropriate and put a copy of the DLL file from your class library project into there and have the web application project reference that file, as opposed to the project.

This will allow you to modify your class project at will, but will also force you to copy things over to make sure you have the latest and greatest in your web application. In your case, this sounds like the preferred method for you.