I created a target called RunNUnitTests and placed it at the bottom of Micirosoft.CSharp.targets.
<NUnit Assemblies="@(TestAssembly)" HaltIfTestFailed="True" Platform="x86"/>
The build configuration defines a environment variable called TEST_ASSEMBLY i.e. path\path\path\MyTests.dll
I setup a build configuration referencing the .sln file of my tests with the Targets "Build RunNUnitTests".
The solution fails with this message :
- C:\BuildAgent\work\581b6fc1e96d4c06\Build\Greetings\GreetingsImpl\GreetingsImplTester.sln error MSB4057: The target "RunNUnitTests" does not exist in the project.
If I build with the .csproj file, then it finds the target just fine.
I even tried moving the target into the csproj file. The solution still fails.
This seems similar to this thread :
Is this a bug or is there are fix for this?