Use a condition to copy just specific assemblies

In my previous post I showed how to use conditional compilation symbols to switch between using statements for AutoCAD and BricsCAD. For both system the interface assemblies are referenced and copy local is set to false.
In a similar case where copy local is set to true you will notice that the referenced assemblies of both configuration are copied into the output directory. As we want to switch the whole system this isn't what we want.
To avoid this you can use a condition so that just the assemblies of one configuration will be in you output directory.

Unload the project and open it in the editor window. Then add the condition to check the DefineConstants and to decide if the assembly will be included or not:

<Reference Condition="$(DefineConstants.Contains(BRICSCAD))" Include="BrxMgd">
    <HintPath>lib\BrxMgd.dll</HintPath>
    <Private>False</Private>
</Reference>