Nice work in identifying this. I would be willing to bet that this problem is related to Fakes attempting to load the Prism/MEF assemblies during its generation of the Fakes. Because NCrunch suppresses the
copying of referenced files to the build output directory of projects by default, Fakes would fail to find these assemblies then explode.
There are two ways you can solve this problem:
1. Include the Prism/MEF extensions as part of your test project (as you have done). This is the approach I would recommend as it will give the best performance.
2. Turn on the
Copy referenced assemblies to workspace setting for the projects that are involved. This will tell NCrunch to always copy the referenced assemblies, thereby allowing the build to function as it would when you invoke it from your IDE. The major drawback of this approach is that you'll lose some very significant optimisations that NCrunch makes to your build, so everything will run slower.
I admit that I'm a bit disappointed in the way this error is being reported. I would have hoped that Fakes build tasks would provide errors and warnings using the standard MSBuild approach.