N2CMS ASP.NET Error: Operation could destabilize the runtime

N2CMS ASP.NET Error: Operation could destabilize the runtime

by , 14 Feb 2013

I have a number of sites running N2CMS and MVC templates and recently received an error alert from my site monitoring facilities drawing my attention to a general site failure. The whole ASP.NET site failed to load with the following error:

Operation could destabilize the runtime.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.VerificationException: Operation could destabilize the runtime.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Up until the error the site worked fine and no updates were made for weeks prior to the failure. The site is hosted with Hostgator on shared hosting so I raised a support ticket to check for any server updates. Hostgator were very responsive and detailed changes made to the server around the same time as the failure. These included MVC updates and ASP.NET framework install of 4.5. After researching ASP.NET 4.5 completely overwrites version 4 rather than adding a new version and this introduced some problems with the version 4 N2CMS code or some of my customisations.

In case this helps others, my fix was to switch the hosting to ASP.NET 2 then adjust assemblies and web.config to use earlier assemblies. The changes were fairly simple for me but took some time to research and replicate locally. I had to upgrade my development system to the latest MVC and ASP.NET 4.5 then switch to mdium trust in order to replicate the errors. Once my local machine was throwing the same errors the solution was more easy to process.

If you see the same problem, hopefully you can apply a similar workround.

Email News: Sign-Up Here

07 579 9554

0275 339 855