ASP.NET MVC 3 - Operation can destabilize runtime

I have an MVC3.0 application (.Net 4.0) that works fine on a Windows 7 development computer (with VS2010). The same application works fine on one of the Windows 8 servers with IIS 7.

However, the same application throws an exception below on another Windows 8 server with IIS7.

An operation can destabilize runtime.

Stack trace:

[VerificationException: operation can destabilize runtime.] System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest (HttpContext context, AsyncCallback cb, Object extraData) System.Web.CallHandlerExecutionStep.pecutepep.ppppystem.pecput.pecputpystem.pecputpystem.pecp.pecpept.psept.psept.psep.psept.psept.psept.psep.psept.psep.psep.pecpeptpystem () System.Web.HttpApplication.ExecuteStep (step IExecutionStep, Boolean and completed synchronously)

Please, can someone help me understand what is causing this problem?

Is this the .NET Framework 4.0? (I confirmed that both servers have .Net Framework 4.0)

Is this a problem with IIS and MVC 3.0? (Do I need to install MVC 3.0 separately to run IIS?)

How do we configure a web application to run FULL TRUST software in IIS 7?

Or completely something else (trying to register iis with spnet_regiis.exe -ir didn't help either)

Is it necessary to install this http://www.microsoft.com/en-us/download/details.aspx?id=1491 on a web server?

Any help would be appreciated.

+4
source share
2 answers

VerificationException is VerificationException when the JIT compiler finds inappropriate type information in assemblies or invalid IL statements. For example, mismatch methods (or return types) between the calling and the called methods (when the method signature is changed and the dependent assemblies are not recompiled).

To solve the problem, you can use peverify to check assemblies:

 peverify MyCompany.WebAppMainAssembly.dll 

He will say that the participant is causing a conflict. Something like found <method sig>, expected <expected signature> . Now you know which builds caused the problem. Install it in the GAC if necessary. MVC, EF and Unity have MSI installers or install manually ...

BTW, to run peverify , open Visual Studio Command Prompt or look for C:\Program Files (x86)\Microsoft SDKs\Windows\<winver>\Bin (this path may change slightly).

+4
source

The problem may be related to this fix: http://support.microsoft.com/kb/2748645

Based on your explanation of the problem and the tests you have already done, this framework error sounds like it is the most likely culprit. Even though you are targeting .Net 4.0, .Net 4.5 replaces .Net 4.0 after installation.

Your Windows 7 machine with VS2010 probably does not have .Net 4.5 and therefore no error is detected.

The production Windows 8 server (which usually comes with .Net 4.5) may have been updated and therefore already has this fix

Therefore, a broken Windows 8 server probably has not yet been updated with this hotfix. (Running regular Windows updates will eventually get this update as well)

You might want to compare installed updates on both servers to ensure a consistent environment.

If you intend to develop machines on which .Net 4.5 is installed, you want to upgrade to VS2012 or manually install .Net 4.5 to reflect the changes. But be careful if you also target machines without .Net 4.5, there are other violations ...

Visual C # Breaking Changes in Visual Studio 2012

Application Compatibility in the .NET Framework 4.5

0
source

All Articles