playtime222;15446 wrote:Turning off instrumentation for the whole solution also works - but then that sort of removes the second primary function of NCrunch - the code coverage dots.
Yes, this will reliably solve the problem as the missing DLL then isn't needed. I also don't recommend doing it as it makes NCrunch far less useful. Worst case scenario you could instead just disable instrumentation for the projects containing aspects.
playtime222;15446 wrote:
1. Changing the project file contents was not immediately reflected in ncrunch test window. Something is being cached somewhere? I tried reloading project and reloading whole solution too.
Because the problem itself is a referencing issue between projects, NCrunch may not have known to rebuild the dependencies, so an engine reset would fix this.
playtime222;15446 wrote:
2. Editing the project file occasionally resulted in a hung, crashed, restarting automatically.
Not wanting to point fingers, but this sounds like a VS bug. No shortage of those around these days.
playtime222;15446 wrote:
3. The projects EntityComponentSystem and EntityComponentSystem.Tests both used to fail before the workaround. EntityComponentSystem ALSO contains aspects. NCrunch compiled these 2 projects (and others dependent on the same aspects) correctly WITHOUT the pre-build event.
4. When I turned off the pre-build events in NCrunch (either individual project or whole solution) Framework.Contracts.Tests continued to compile correctly??!!!???
The pre-build event will copy the NCrunch DLL into the required place in the build output directory of the project involved. If the event is deactivated or removed, the file may still be there somewhere in a search path where the PostSharp build step can find it. I'm not sure what kind of dependency handling PostSharp use inside their build step, but it may be quite sophisticated. Assume you will always need the pre-build step in projects that declare aspects, as otherwise the problem is highly likely to resurface in a future session.