If you have two related projects that care enough for you that they are in the same type and configuration (which means that you are not using any third-party package that you are using), you should put them in one and the same solution.
If for some reason you cannot , there is another (slightly ugly) solution.
You can edit your .csproj and "dynamically" target-based link assemblies. In the .csproj file, the links are inside an XML element called "ItemGroup". In each element group, you have many Link elements, and the assembly path is in the Tip element. You can put the $ (Configuration) variable in the tooltip. For instance:
<ItemGroup> <Reference Include="your assembly"> <HintPath>..\..\$(Configuration)\blabla.dll</HintPath> </Reference> </ItemGroup>
Thus, the directory name will contain your configuration name (they must match - this means that if you change the names that you violate).
Another option is to define three groups that are completely different and use the Condition attribute:
- A group of unconditional elements that will be used to refer to System, System.xml, etc.
- A group of elements with the attribute
Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " , which will contain links that will be used in the debug configuration. - A group of elements with the attribute
" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " for the Release configuration.
In each group of elements you will have a link to the assembly in the correct configuration.
This is a little ugly because .csproj is sometimes automatically modified, and you can easily forget and make a mess out of it. But in any case, it will work.
source share