If you prefer to develop my unit tests as part of the project you are trying to test, you can add the following condition to the unit test files and a link to nunit in the project file.
Condition=" '$(Configuration)'=='Debug' "
This will only include a link to nunit, as well as your test classes in the assembly when you are in debug mode.
So your project file may have something like this:
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" Condition=" '$(Configuration)'=='Debug' "> <HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath> </Reference> <Compile Include="UnitTests.cs" Condition=" '$(Configuration)'=='Debug' "/>
source share