Telexer

Does anyone know how to configure a project or solution build to conditionally pick up specific copies of DLLs maintianed in other solutions

I'm referencing several DLLs which are built in other solutions as class libraries. When I build in DEBUG configuration mode, I want to pick up the debug copies of the DLLs. When I build in RELEASE mode I want to pick up the release copies.

I'm using VS2005 C#. All my solutions maintain built projects in the standard VS paths.

Example

..\MyProject\bin\Debug

..\MyProject\bin\Release

I appreciate any advice or pointers. Thanks.



Re: Visual C# IDE Setting reference conditions in Build configurations

nobugz

Moved to C# IDE forum.





Re: Visual C# IDE Setting reference conditions in Build configurations

Peter Ritchie

If you have a solution with all the projects referenced it will copy the correct configuration automatically. If all you has is two DLLs (one release, one debug), Visual Studio is only designed to reference one DLL per project (which is the same for all configurations). If you reference a particular DLL it will automatically be copied. You'll have to switch to a debug DLL when you want to debug it and switch back to release otherwise.




Re: Visual C# IDE Setting reference conditions in Build configurations

Telexer

Peter,
Thanks for the quick reply.

Yes, I have different DLLs for DEBUG and RELEASE, since RELEASE is performance optimized and has the debug switches turned off. And changing all the project references is a ton of clicks and error prone.

Since I only build to RELEASE occasionally ,will the following work I could run a project RELEASE build which has references to all the DEBUG DLLs. Then run a script to copy all the RELEASE DLLs from my class libraries into my ..\MyProject\bin\Release folder. Will I end up with a valid set of RELEASE files





Re: Visual C# IDE Setting reference conditions in Build configurations

nobugz

It is not very intuitive, but, when you add the reference for a class library project in your solution, use the Project tab. That way, the debug version of your app will use the debug build of the library and the release version will use the release build.





Re: Visual C# IDE Setting reference conditions in Build configurations

Telexer

Hans,

Thanks, that's a great hidden secret to know.

It works well when the class library DLLs are in another project in the SAME solution.

But in my case, my class libraries are in other solutions, and they do not show up in the Project tab when creating a reference. I have to browse to find the DLLs.