I've a MVC3.0 (.Net 4.0) application which runs perfectly fine on Windows 7 development machine (with VS2010). The same application also runs fine on one of the Windows 8 Server with IIS 7.
However, the very same application throws the exception below on other Windows 8 Server with IIS7.
Operation could destabilize the runtime.
Stack Trace:
[VerificationException: Operation could destabilize the runtime.] System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Please, could someone help me to understand what is causing this issue?
Is it .NET Framework 4.0? (I verified both servers have .Net Framework 4.0 installed)
Is it IIS and MVC 3.0 Issue? (Do we need to install MVC 3.0 separately for IIS to run?)
How do we setup the web app to run on FULL TRUST in IIS 7?
Or completely something else (tried registering the iis with spnet_regiis.exe -ir did not help either)
Is it necessary to install this http://www.microsoft.com/en-us/download/details.aspx?id=1491 on web server?
Any help will be appreciated.
The
VerificationExceptionis thrown when the JIT compiler find mismatching type information in the assemblies or invalid IL instructions. For example, mismatching methods signatures (or return types) between callers and called method (when a method's signature is changed and the dependent assemblies are not recompiled).To solve the problem you can use
peverifyto check the assemblies:It will tell what member is causing the conflict. Something like
found <method sig>, expected <expected signature>. Now you know what assembly caused the problem. Reinstall it in the GAC if necessary. MVC, EF and Unity have msi installers, or install by hand...BTW, to run the
peverifyopen theVisual Studio Command Promptor look for inC:\Program Files (x86)\Microsoft SDKs\Windows\<winver>\Bin(this path can change a bit).