Error - URGENT : Operation could destabilize the runtime.

Topics: Administration, Core, General
Nov 17, 2012 at 8:49 PM
Edited Nov 18, 2012 at 3:14 AM

My website based on orchard 1.3 version, it was working fine.

Suddenly yesterday when I visited the website, I say this error:

RUNTIME ERROR

!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>

So I added  this line in my webconfig:

<customErrors> tag just after <system.web> like this

<system.web>
<customErrors mode="Off" />

 

 tag just after  like this



Now I am getting this error:

 


 

Server Error in '/' Application.

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:

 

Line 8:      public class WarmupSettingsPartHandler : ContentHandler {
Line 9:          public WarmupSettingsPartHandler(IRepository<WarmupSettingsPartRecord> repository) {
Line 10:             Filters.Add(new ActivatingFilter<WarmupSettingsPart>("Site"));
Line 11:             Filters.Add(StorageFilter.For(repository));
Line 12:         }

 

Server Error in '/' Application.
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:


Line 8:      public class WarmupSettingsPartHandler : ContentHandler {
Line 9:          public WarmupSettingsPartHandler(IRepository repository) {
Line 10:             Filters.Add(new ActivatingFilter("Site"));
Line 11:             Filters.Add(StorageFilter.For(repository));
Line 12:         }
Nov 17, 2012 at 8:50 PM
Edited Nov 17, 2012 at 8:51 PM

By online research, I have also tried this by making:

 

<!--<trust level="Medium" originUrl="" />-->

 

TO

 

<!--<trust level="Full" originUrl="" />-->

 

Still same error...

 

This is my complete webconfig..FYI:

<?xml version="1.0" encoding="UTF-8"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor" requirePermission="false" />
     
    </sectionGroup>

    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false" />

   
  </configSections>
 
  <appSettings>
    <add key="webpages:Enabled" value="false" />
    <add key="log4net.Config" value="Config\log4net.config" />
  </appSettings>

  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Linq" />
        <add namespace="System.Collections.Generic" />
        <add namespace="Orchard.Mvc.Html" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>


  <!--
        Set default transaction timeout to 30 minutes so that interactive debugging
        is easier (default timeout is less than one minute)
  -->
  <system.transactions>
    <defaultSettings timeout="00:30:00" />
  </system.transactions>
  <system.web>

<customErrors mode="Off" />

    <!--<trust level="Full" originUrl="" />-->

    <httpRuntime requestValidationMode="2.0" />
    <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
    -->
    <compilation debug="true" targetFramework="4.0" batch="true" numRecompilesBeforeAppRestart="250" optimizeCompilations="true">
        <buildProviders>
        <add extension=".csproj" type="Orchard.Environment.Extensions.Compilers.CSharpExtensionBuildProviderShim" />
      </buildProviders>
      <assemblies>
        <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <remove assembly="System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <remove assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <remove assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <remove assembly="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <remove assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <remove assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <remove assembly="System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <remove assembly="System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <remove assembly="System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <remove assembly="System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <remove assembly="System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <remove assembly="System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <remove assembly="System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <remove assembly="System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <remove assembly="System.WorkflowServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <remove assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <remove assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <remove assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </assemblies>
    </compilation>
    <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
    -->
    <authentication mode="Forms">
      <forms loginUrl="~/Users/Account/AccessDenied" timeout="2880" />
    </authentication>

   

    <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.
    -->
   
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Linq" />
        <add namespace="System.Collections.Generic" />
        <add namespace="Orchard.Mvc.Html" />
      </namespaces>
    </pages>

    <httpHandlers>
      <!-- see below -->
      <clear />
      <add path="*" verb="*" type="System.Web.HttpNotFoundHandler" />

    </httpHandlers>

    <httpModules>
      <add name="WarmupHttpModule" type="Orchard.WarmupStarter.WarmupHttpModule, Orchard.WarmupStarter, Version=1.0.20, Culture=neutral" />
    </httpModules>
   
  </system.web>
  <!--
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
  -->
  <system.webServer>

    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="WarmupHttpModule" />
      <add name="WarmupHttpModule" type="Orchard.WarmupStarter.WarmupHttpModule, Orchard.WarmupStarter, Version=1.0.20, Culture=neutral" />
    </modules>
    <handlers accessPolicy="Script">
      <!-- clear all handlers, prevents executing code file extensions, prevents returning any file contents -->
      <clear />
      <!-- Return 404 for all requests via managed handler. The url routing handler will substitute the mvc request handler when routes match. -->
      <add name="NotFound" path="*" verb="*" type="System.Web.HttpNotFoundHandler" preCondition="integratedMode" requireAccess="Script" />
    </handlers>
        <directoryBrowse enabled="false" />
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="App_Data/Dependencies" />
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="3.0.0.0" />
        <bindingRedirect oldVersion="2.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Nov 17, 2012 at 8:56 PM

This website is hosted on ARVIXE server with Full Trust Level - if this information helps,

By doing more research on this forum, it seems like if hosting company upgrades the framework from 4.0 to 4.5, this error comes.

Any work around for this problem (without upgrading to latest version) ?

Nov 17, 2012 at 11:13 PM

You are not saying what version of Orchard you are running, but my guess is Arvixe has updated their .NET to 4.5 and your are having issues described here:

http://orchard.codeplex.com/discussions/401017

ttp://orchard.codeplex.com/discussions/392307

If that's the case you will have to upgrade to 1.6.

Nov 17, 2012 at 11:15 PM
Edited Nov 17, 2012 at 11:16 PM

I had a similar error but with the Vandelay module. Do a Google search on that - I don't remember exactly if it has to do with .NET 4.5. which I installed and which caused problems on a 1.4 site. 

Take note that if you have < 1.5 of Orchard then, if I recall, you will have this problem.  I also seem to remember that 1.5+ would resolve that issue. I didn't have time to upgrade so these were the steps I took:

1) Uninstalled .NET 4.5. There are some traps here. I think uninstalling it through Control Panel seems to roll back to .NET 3.5.

2) If you get rolled back to .NET 3.5, install .NET 4.0 through the MS Web Platform Installer.

3) Uninstalling .NET 4.5 will cause IIS to reset the APP Pool to 2.0, so after you install .NET 4.0, set your app pool on the site (or all tenants) to 4.0 from 2.0.

I understand you may not have access to the server, so if that's the case I think your only solution is to upgrade to 1.5 or 1.6.

Someone please correct me if I am wrong.

EDIT: I posted at the same time as @SKam, so what (s)he said.

Nov 18, 2012 at 3:14 AM

My website is based on Orchard 1.3 version

Coordinator
Nov 18, 2012 at 8:24 AM

From what you are saying in a previous post, you are *not* running full trust. This here: <!--<trust level="Full" originUrl="" />--> is commented out. Remove the <!-- and -->

Also, the issue with .NET 4.5 has been patched by the ASP.NET team, so your hoster, if they are running 4.5, are not running the latest patches for it. They should.

You should also upgrade your Orchard.

Nov 18, 2012 at 1:46 PM

I have tried removing  the <!-- --> since I know this means commented but getting the same error.

 

So with the latest patch by ASP.NET team, even if  the website is intended to build in 4.0 framework, it will work in 4.5 too ?

So what should I say to my hosting company ? what should I ask them to do or install ?

 

Right now its not easy to upgrade because the website is highly customized to it will take a while to upgrade that's why I need an alternative (if possible) to keep my website running until I upgrade to latest version because right now the website is like shut down and giving the above errors.

So if my hosting company install the latest patch by asp.net team - this should resolve the issue you think ?

Coordinator
Nov 19, 2012 at 7:44 AM

Yes. You should ask your hosting company to check that they have the latest asp.net patches. It should resolve the issue. Windows Update should do the trick, but here are the download links:

For Win8
http://blogs.msdn.com/b/b8/archive/2012/10/09/updating-windows-8-for-general-availability.aspx

For x86
http://go.microsoft.com/fwlink/?LinkID=267766&clcid=0x409

For x64
http://go.microsoft.com/fwlink/?LinkID=267886&clcid=0x409