However I got a problem which has occured a few times today where NCrunch has been using an older version of the source files to those in my solution, specifically a version which doesn't compile and therefore stops all tests from running.
The solution has the following projects:
- 2 x VB Windows App
- 1 x C# Web Application
- 2 x C# Class Library (one with classes (lets call it A), one with tests (B))
- 1 x C# Windows App
My tests are currently in one of the C# projects (B), and only reference the other C# class library project (A). The referenced project has <10 classes in it, and so far I've got 3 test classes in project B.
NCrunch appears to have been trying to use a previous (non-compiling) version of two of my class files (in project A), both of which had XmlElement attributes decorating the class (causing the compile error), which have since been changed to [XmlRoot]. I've checked the working folder, and the files are definitely the wrong ones.
Things I've tried which haven't helped (that I can see):
[list=1]
I played around for a bit and found two solutions:
[list=1]
Interestingly, I've just switched back to VS2010 and I'm getting the same errors as previous, despite having fixed them earlier with the second solution above. I doubt the errors are relevant, but I've included them below just in case:
[20:23:40.6994-BuildTask-59] ERROR (Compilation): RAC.Integration.Shared: PDD\PaperlessDirectDebit.cs (9): Attribute 'XmlElement' is not valid on this declaration type. It is only valid on 'property, indexer, field, param, return' declarations.
[20:23:40.6994-BuildTask-59] ERROR (Compilation): RAC.Integration.Shared: PDD\PaperlessDirectDebitList.cs (9): Attribute 'XmlElement' is not valid on this declaration type. It is only valid on 'property, indexer, field, param, return' declarations.
One final thing... I just cleared out all previous versions from the working directory. NCrunch failed with multiple "Can't find file X" errors. I resync'd / restarted NCrunch from within visual studio, forced a rebuild of project A, and it failed again with the same errors as above!! Very odd... no idea where that code is, but its clearly cached somewhere.
If you need any more info - let me know!
Simon