title: Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()'
body: <p>Updates: put one mvc4 solution to another mvc4 solution!</p>
  
  <p>I search same question on stackoverflow ,but it didn't work! so I ask again!</p>
  
  <blockquote>
    <p>Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed. </p>
  </blockquote>
  
  <p>Stack trace:</p>
  
  <blockquote>
    <p>[MethodAccessException: Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed.]
       WebMatrix.WebData.PreApplicationStartCode.Start() +112</p>
    
    <p>[InvalidOperationException: The pre-application start initialization method Start on type WebMatrix.WebData.PreApplicationStartCode threw an exception with the following error message: Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed..]
       System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection<code>1 methods, Func</code>1 setHostingEnvironmentCultures) +547
       System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +132
       System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean&amp; isRefAssemblyLoaded) +102
       System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
       System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +521</p>
    
    <p>[HttpException (0x80004005): The pre-application start initialization method Start on type WebMatrix.WebData.PreApplicationStartCode threw an exception with the following error message: Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed..]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9930508
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254</p>
  </blockquote>
  
  <p>my project environment is vs2013、mvc4</p>