This project has moved and is read-only. For the latest updates, please go here.

{"Operation could destabilize the runtime."}

Mar 17, 2011 at 12:05 PM
Edited Mar 17, 2011 at 1:10 PM


I have a quick question regarding unit testing and Irony.

I have been developing an application and i've been using Irony as a parser for the input of my application, which works fine by itself.

I recently started a Visual Studio Unit Test, to test the application. I kept getting the same error and i found out that it had something to do with Irony.dll.

Every time i run my application Irony works fine, but if i set my startup project to my Unit Test project to run Irony, i keep getting the following error:

[System.Security.VerificationException] {"Operation could destabilize the runtime."}

this always happens on the following line(constructor)

 public Grammar() : this(true) { } //case sensitive by default
I tried to find out why this happens, so i redownloaded Irony, along with the Irony test samples and visual studio unit tests.
I keep getting the same error there too, when i set 040.Irony.Tests.VsTest.2010 as my startup project and try to debug.
Can anyone give me any pointers regarding this?
I'm running Visual Studio 2010 Ultimate, Windows 7 Enterprise Edition x64 Bit
Mar 23, 2011 at 6:40 PM

Google search for this error brings a few forum posts that all indicate that there must be some mismatch of old-version DLL, built for earlier runtime, with new ones. Like you reference a DLL build in .NET 2.0, and because of some changes in .NET 4.0 running the older version my represent a risk of this destabilization.

Do you use some extra libraries in compiled form? Mocking framework, extra unit test frameworks? 

I never seen this, at least in Grammar constructor. I do use VS unit test framework, it works OK. Do you have Irony included as project or you reference DLL? 

My suggestion is to check all referenced DLLs, in all projects, check their versions, see if you find any older stuff; try to find sources and rebuild them in .NET 4.0; or get the latest binaries