Hello,
I've just installed NCrunch and tried it out on a pretty small project with about 400 tests. When I enable NCrunch I get the exception "System.Security.VerificationException : Operation could destabilize the runtime." on almost every tests in my solution. I use ReShaper as well and when I run the tests through ReSharpers test-runner everything works well.
I use NUnit as test framework and FakeItEasy for faking/mocking/stubbig. The tests are just pure unit tests, not integration tests.
The exception occurs on very strange places, for example in the constructor of a class and even if I blank the constructor and remove the code I still get the exception.
Any idea what can cause this?
Here is the log from when I running one test that fails:
Process 8516: 11:39:03.8782 - Running 1 tests using framework: nCrunch.TestExecution.Frameworks.NUnit.NUnitTestFramework
Process 8516: 11:39:04.2401 - Running 1 tests on background thread with ID 11
Process 8516: 11:39:04.2872 - 11 NUnit SuiteStarted: [0-1001]MyProject.Tests.DomainConfig.DomainConfigDocumentBuilderTests
Process 8516: 11:39:04.3223 - Now monitoring execution of: MyProject.Tests.DomainConfig.DomainConfigDocumentBuilderTests.
Process 8516: 11:39:04.3223 - Enforcing timeout of 60000
Process 8516: 11:39:04.3674 - 11 NUnit TestStarted: [0-1010]MyProject.Tests.DomainConfig.DomainConfigDocumentBuilderTests.BuildWithDomainElementsRemoved_DomainsElementNotSet_ThrowsArgumentException
Process 8516: 11:39:04.3775 - Now monitoring execution of: MyProject.Tests.DomainConfig.DomainConfigDocumentBuilderTests.BuildWithDomainElementsRemoved_DomainsElementNotSet_ThrowsArgumentException
Process 8516: 11:39:04.3775 - Enforcing timeout of 60000
Process 8516: 11:39:04.3915 - 11 NUnit TestFinished: MyProject.Tests.DomainConfig.DomainConfigDocumentBuilderTests.BuildWithDomainElementsRemoved_DomainsElementNotSet_ThrowsArgumentException, False, System.Security.VerificationException : Operation could destabilize the runtime., at MyProject.DomainConfig.Repository.DomainConfigDocumentBuilder..ctor(XmlDocument domainConfigDocument) in C:\Projects\MyProject\Development\MyProject.Cms.EPiSrvr\DomainConfig\Repository\DomainConfigDocumentBuilder.cs:line 13
Process 8516: at MyProject.Tests.DomainConfig.DomainConfigDocumentBuilderTests.BuildWithDomainElementsRemoved_DomainsElementNotSet_ThrowsArgumentException() in C:\Projects\MyProject\Development\MyProject.Tests\Cms\EPiSrvr\DomainConfig\DomainConfigDocumentBuilderTests.cs:line 93
Process 8516: 11:39:04.3985 - Now monitoring execution of: MyProject.Tests.DomainConfig.DomainConfigDocumentBuilderTests.
Process 8516: 11:39:04.3985 - Enforcing timeout of 60000
Process 8516: 11:39:04.4005 - 11 NUnit SuiteFinished: MyProject.Tests.DomainConfig.DomainConfigDocumentBuilderTests, False, Child test failed,
Process 8516: 11:39:04.4055 - Instrumented test run complete
Process 8516:
[11:39:04.4356-TestExecutionTask-40] Storing process 8516 in pool
[11:39:04.4356-TestExecutionTask-40] Task processing complete for [TestExecutionTask: [SnapshotComponent: MyProject.Tests, 2, 22874059], 1 test(s), NUnit, BeingProcessed], processing time: 00:00:00
[11:39:04.4366-TestExecutionTask-40] Publishing Event: [#=q7XRRea$7ZE8ErbSXm5RK0x2fiVUhM4GWUWURbtQgB_o=:[TestExecutionTask: [SnapshotComponent: MyProject.Tests, 2, 22874059], 1 test(s), NUnit, BeingProcessed]]
[11:39:04.4366-TestExecutionTask-40] Event [#=q7XRRea$7ZE8ErbSXm5RK0x2fiVUhM4GWUWURbtQgB_o=:[TestExecutionTask: [SnapshotComponent: MyProject.Tests, 2, 22874059], 1 test(s), NUnit, BeingProcessed]] is being published on thread CoreThread to subscriber: ProcessingQueue.#=qsWkGjuOFhpNySlSjZ2DRsSjYIHxLG6ScY3i2G_jEHZs=
[11:39:04.4366-Core-15] Event [#=q7XRRea$7ZE8ErbSXm5RK0x2fiVUhM4GWUWURbtQgB_o=:[TestExecutionTask: [SnapshotComponent: MyProject.Tests, 2, 22874059], 1 test(s), NUnit, BeingProcessed]] is being processed on Core thread with subscriber: ProcessingQueue.#=qsWkGjuOFhpNySlSjZ2DRsSjYIHxLG6ScY3i2G_jEHZs=