Hi Max,
Thanks for posting.
As NCrunch works with your source code in its pre-built state, there are some serious limits to what we can do here. Structurally, we can't make use of the assemblies that may have been pre-built by the IDE ... This is due to a range of issues such as concurrency restrictions, assembly structure, build chaining issues, configuration constraints, metrics holes, etc. This means that for NCrunch to use an assembly derived from a project, it must take responsibility for building that project itself.
The good news is that once a project has been built by NCrunch, it won't need to build it again unless you reset the engine or alter any source code inside the built project. This means that the weighty projects slowing you down should only slow you down when the engine first spins up. They may also carry some weight in some of the internal engine operations, such as building data for the UI and merging code coverage, but we've optimised these areas very heavily over the years so you'll need some serious weight to notice a big change in these.
From here, there are a couple of options if you want to remove these projects from the scope of NCrunch. Neither of these are ideal and in each case they are likely to be more trouble than they are worth:
- You can use the 'Ignore this project completely' setting to remove unwanted projects from NCrunch's internal solution. Note that this will only work for projects that none of your crunchable code relies on. If you try to ignore a required project, the engine will fail to build its dependencies.
- You can externalise the unwanted projects by using assembly references instead of project references. Removing them from the solution is possible but not required (as you can ignore them under NCrunch). In theory, it may be possible to use MSBuild conditions to have a project reference in place for Visual Studio, and an assembly reference in place for NCrunch. I don't know how the IDE would behave with such a structure though, and it'll be quite fragile. Regardless, you'd be wanting to pre-build the project using the IDE and store its built assembly in a place that is referenced and manually updated.