Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

System.Security.VerificationException : Operation could destabilize the runtime.
modhelius
#1 Posted : Tuesday, April 24, 2012 9:55:15 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/24/2012(UTC)
Posts: 2
Location: Stockholm

Was thanked: 1 time(s) in 1 post(s)
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=
Remco
#2 Posted : Tuesday, April 24, 2012 9:58:44 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for posting!

Are you making use of any of the security features of the .NET runtime? Or is there anything that could be considered unusual about this particular project? (i.e. custom frameworks, build steps, environmental differences).
modhelius
#3 Posted : Wednesday, April 25, 2012 12:28:17 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/24/2012(UTC)
Posts: 2
Location: Stockholm

Was thanked: 1 time(s) in 1 post(s)
Thanks for the reply. After some troubleshooting I found that the [assembly: SecurityTransparent] of some unknown reason was set in the shared AssemblyInfo for the solution. After I've removed that attribute everyting started working.

NCrunch really looks promising by the way! It will be a pleasure to try it out!

Best Regards
Martin
1 user thanked modhelius for this useful post.
Remco on 4/25/2012(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.040 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download