title: Operation could destabilize the runtime in mvc3 razor
body: <p>I am working in mvc3 razor my project fistly run correctly but i get the error </p>
  
  <pre><code>Error   3   Assembly 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral,     PublicKeyToken=31bf3856ad364e35' uses 'System.Web.WebPages, Version=2.0.0.0, Culture=neutral,     PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced     assembly 'System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'        c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Mvc.dll    MvcApplication1
  </code></pre>
  
  <p>and i replace the system.web.mvc.dll and System.Web.WebPages.Razor files from mvc4 folder to mvc3 folder. and some changes in web.config and it start working correctly. but now after few days it show me the following error message </p>
  
  <p>Operation could destabilize the runtime</p>
  
  <p>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. </p>
  
  <p>Exception Details: System.Security.VerificationException: Operation could destabilize the runtime.</p>
  
  <p>Source Error: </p>
  
  <p>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.</p>
  
  <pre><code>Stack Trace: 
  
  
  [VerificationException: Operation could destabilize the runtime.]
  System.Web.Mvc.Razor.MvcWebPageRazorHost.GetRidOfNamespace(String ns) +32
  System.Web.Mvc.Razor.MvcWebPageRazorHost..ctor(String virtualPath, String physicalPath) +196
  System.Web.Mvc.MvcWebRazorHostFactory.CreateHost(String virtualPath, String physicalPath) +113
  System.Web.WebPages.Razor.WebRazorHostFactory.CreateHostFromConfigCore    (RazorWebSectionGroup        config, String virtualPath, String physicalPath) +422
  System.Web.WebPages.Razor.WebRazorHostFactory.CreateHostFromConfig(String virtualPath, String physicalPath) +228
  System.Web.WebPages.Razor.WebRazorHostFactory.CreateHostFromConfig(String virtualPath) +38
  System.Web.WebPages.Razor.RazorBuildProvider.GetHostFromConfig() +51
  System.Web.WebPages.Razor.RazorBuildProvider.CreateHost() +57
  System.Web.WebPages.Razor.RazorBuildProvider.get_Host() +56
  System.Web.WebPages.Razor.RazorBuildProvider.EnsureGeneratedCode() +92
  System.Web.WebPages.Razor.RazorBuildProvider.get_CodeCompilerType() +54
  System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) +59
  System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() +209
  System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +15
  System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +9929933
  System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +299
  System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +103
  System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) +165
  System.Web.Compilation.BuildManager.GetObjectFactory(String virtualPath, Boolean throwIfNotFound) +33
  System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.FileExists(String virtualPath) +40
  System.Web.Mvc.BuildManagerViewEngine.FileExists(ControllerContext controllerContext, String virtualPath) +54
  System.Web.Mvc.VirtualPathProviderViewEngine.GetPathFromGeneralName(ControllerContext controllerContext, List1     
  locations, String name, String controllerName, String areaName, String cacheKey, String[]&amp; searchedLocations) +197
  System.Web.Mvc.VirtualPathProviderViewEngine.GetPath(ControllerContext controllerContext, String[] locations, String[] areaLocations, String locationsPropertyName, String name, String   controllerName, String cacheKeyPrefix, Boolean useCache, String[]&amp; searchedLocations) +681
  System.Web.Mvc.VirtualPathProviderViewEngine.FindView(ControllerContext controllerContext,  String     viewName, String masterName, Boolean useCache) +315
  System.Web.Mvc.&lt;&gt;c__DisplayClassc.&lt;FindView&gt;b__b(IViewEngine e) +68
  System.Web.Mvc.ViewEngineCollection.Find(Func2 lookup, Boolean trackSearchedPaths) +182
  System.Web.Mvc.ViewEngineCollection.Find(Func2 cacheLocator, Func2 locator) +110
  System.Web.Mvc.ViewEngineCollection.FindView(ControllerContext controllerContext, String     viewName, String masterName) +329
  System.Web.Mvc.ViewResult.FindView(ControllerContext context) +135
  System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +230
  System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +39
  System.Web.Mvc.&lt;&gt;c__DisplayClass1c.&lt;InvokeActionResultWithFilters&gt;b__19() +74
  System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, 
  Func1 continuation) +388
  System.Web.Mvc.&lt;&gt;c__DisplayClass1e.&lt;InvokeActionResultWithFilters&gt;b__1b() +72
  System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext,IList1filters, ActionResult actionResult) +303
  System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +844
  System.Web.Mvc.Controller.ExecuteCore() +130
  System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +229
  System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +39
  System.Web.Mvc.&lt;&gt;c__DisplayClassb.&lt;BeginProcessRequest&gt;b__5() +71
  System.Web.Mvc.Async.&lt;&gt;c__DisplayClass1.&lt;MakeVoidDelegate&gt;b__0() +44
  System.Web.Mvc.Async.&lt;&gt;c__DisplayClass8
  1.&lt;BeginSynchronous&gt;b__7(IAsyncResult _) +42
  System.Web.Mvc.Async.WrappedAsyncResult
  1.End() +152
  System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
  System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
  System.Web.Mvc.&lt;&gt;c__DisplayClasse.&lt;EndProcessRequest&gt;b__d() +75
  System.Web.Mvc.SecurityUtil.&lt;GetCallInAppTrustThunk&gt;b__0(Action f) +31
  System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +61
  System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +118
  System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38
  System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9629708
  System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +155
  </code></pre>
  
  <p>settings in my web.config are as under</p>
  
  <pre><code>&lt;assemblies&gt;
  &lt;add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35" /&gt;
   &lt;add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
   &lt;add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
   &lt;add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
   &lt;add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
      &lt;add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt;
    &lt;/assemblies&gt;
  </code></pre>
  
  <p>Please any one give me help about this.</p>