Hi,
I just remembered that CommonTestActions is my own custom target.
It is defined in a separate *.targets file (included in the same project as a <None /> item as well).
I tried adding it to the AdditionalFilesToInclude but it still does not build.
See bug report as well ("CommonTestActions problem").
Thanks for sending through the bug report. I've noticed quite a few references to the custom targets file and it looks as though it's going into the workspace, so I think this may be an issue with the build itself rather than the workspacing.
When your project fails to build, can you:
* Right click the component in the tests window
* Choose to browse to the workspace
* Check that the .targets file is in the correct place in the workspace, relative to the .csproj file
* Have a look at the .csproj file itself to see if its reference to the targets file looks correct
* Try running MSBuild directly against the .csproj file to see if it complains about this issue
This will help to give more information about why the build is failing for NCrunch but not in your IDE.
Hi Remco,
I have found one issue with custom tasks not being included into AdditionalFilesToInclude.
After I did that, I tried MSbuild in the workspace dir, and it complained about:
"C:\Users\me\AppData\Local\NCrunch\4360\454\CodeFolder1\CodeFolder2\Tests\Tests.csproj" (default target) (1) ->
(ResolveTestReferences target) ->
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error : Could not load file or assembly 'MyReferencedAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
I have anonymized the message, but that assembly is produced by the project reference of a Tests.csproj.
On the other hand, while in MSBuild BeforeBuild runs correctly, in NCrunch it is still (0): The target "CommonTestActions" does not exist in the project.
Same happens after rebuild.
It's possible that the MSBuild error is because of the build being run out of sequence (which can happen if it's invoked via command line), though I find it strange the MSBuild and NCrunch would return a different result from the same build file, as they are both doing essentially the same thing. Does restarting your IDE after setting the AdditionalFilesToInclude setting make any difference to the results from NCrunch?
Considering your build customisations, you may want to have a look using $(NCrunch)=='1' for some steps in your build. This property is present (via environment variable) in every build process used by NCrunch, and it can be used to implement conditional build logic based on whether NCrunch is responsible for executing the build or not.