There is a way to do this, but you will have to manually edit the project files. Project files can have the Condition attribute applied to them in many elements, including for links.
You can add them to your links to indicate when to use the link:
<Reference Include="Product, Version=1.0.0.0" Condition="'$(Configuration)'=='V1'"> </Reference> <Reference Include="Product, Version=2.0.0.0" Condition="'$(Configuration)'=='V2'"> </Reference> <Reference Include="Product, Version=3.0.0.0" Condition="'$(Configuration)'=='V3'"> </Reference>
Then you define several assembly configurations ( V1 , V2 , V3 ), and each link will be included only in the corresponding selected assembly configuration.
Combine this with conditional compilation symbols and #if statements in your code, and you can do what you want.
Care should be taken if you do this because Visual Studio can easily remove conditional attributes from a project file.
adrianbanks Nov 24 '09 at 0:36 2009-11-24 00:36
source share