This can be done with a little manual project file management.
First you need to right-click on the project and click "Unload project". Then right-click it and select "Edit" [project name].
When it is loaded into the editor, you will see various entries for your reflections:
<ItemGroup> <Reference Include="System.Xml" /> <Reference Include="WindowsBase"> <RequiredTargetFramework>3.0</RequiredTargetFramework> </Reference> <Reference Include="PresentationCore"> <RequiredTargetFramework>3.0</RequiredTargetFramework> </Reference> <Reference Include="PresentationFramework"> <RequiredTargetFramework>3.0</RequiredTargetFramework> </Reference> <Reference Include="Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\Common\Lib\3rdParty\Prism\4.0\Desktop\Microsoft.Practices.ServiceLocation.dll</HintPath> </Reference> </ItemGroup>
Note that they are inside the ItemGroup node. Now you can do a little magic ... add an expression to your ItemGroup so that it is used only if the assembly configuration has a certain bit size:
<ItemGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> <Reference Include="System.Xml" /> </ItemGroup>
Please note: there is no way to do this through the user interface, so you will have to manually manage these link lists (for example, if you need to add another link).
Also note that this is not a hack ... it just uses one of the MSBuild functions (which VS uses to build its projects). You can have as many ItemGroup lists as you want using any expression you like - if it does not have an expression, it will always be included in the assembly.
slugster
source share