I am working on VS2010 C# and I want to add a .dll reference compiled under VS2008; this .dll exists in 2 versions: Debug and Release.
The .dll is not under .NET, COM or projects tabs, so I only have the “browser” tab to add the .dll to the reference.
My question is: How can I indicate to VS to take the release .dll version when I compile in the release mode and to take the debug .dll version when I compile in the debug mode?
Thanks.
You’ll probably need to manually edit the underlying .csproj file. Approximately thusly
(May be easy to add a reference to debug version via browse, then right click project in solution explorer, click ‘Unload project’, then right click again, ‘Edit your.csproj’, make the edit suggested above to the Foo.dll that you just added, then right click, ‘Reload project’.)
EDIT
To prevent seeing two copies inside VS, maybe something like
That is, conditionally set
Visiblemetadata under the reference node to true/false based on the condition. I haven’t tried to to know if it works.