Build/Test Issues

NCrunch building csproj files not in solution?

Started by Argamon on 1,600 views

As we have a pretty large solution we use different Visual Studio solutions (sln files) while still having everything in one folder.

For some reason NCrunch still decides to build the csproj files not contained in the solution.

This makes the test output window quite hard to read, cause it gets polluted with warnings telling about using project references instead of normal references.

How can we get rid of this behavior?
Hi, thanks for posting.

This behaviour is by design. As NCrunch takes responsibility for building your projects, it needs to first build the dependencies of the projects in your solution before they can be built. If a project inside your solution has a reference to another project outside of the solution, the outside project structurally must be built before the inner one can. For this reason, any project referenced outside the solution will be implicitly included by NCrunch in its solution space.

If you're seeing warnings about lost project references. it's likely that you have some projects in your solution referencing output assemblies, while others are referencing the projects responsible for those assemblies. To avoid the warning, you'll need to have a consistent solution (i.e. either use the assembly, or the project, but not both inside the same solution).

As the warnings are appearing for projects that you don't have open inside the IDE, it's quite likely that you'll just be able to 'ignore' them in the Tests Window and the engine may simply be able to carry on normally. The projects outside your solution will float in the background but as you aren't making changes to them, they'll only be built once and shouldn't interfere with your session.

Post a reply

Log in to reply.