I am trying to do a manual upgrade to 7.35. The backoffice is working just fine but the front end is not. I had to add back the Microsoft.web.helpers.dll because Umbraco complained that it did not exist. When I add it back I get this error. Any thoughts?
Attempt by security transparent method 'Microsoft.Web.Helpers.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed.
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.MethodAccessException: Attempt by security transparent method 'Microsoft.Web.Helpers.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed.
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.
Stack Trace:
[MethodAccessException: Attempt by security transparent method 'Microsoft.Web.Helpers.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed.]
Microsoft.Web.Helpers.PreApplicationStartCode.Start() +70
[InvalidOperationException: The pre-application start initialization method Start on type Microsoft.Web.Helpers.PreApplicationStartCode threw an exception with the following error message: Attempt by security transparent method 'Microsoft.Web.Helpers.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed..]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +12619939
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +12619660
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +280
System.Web.Compilation.BuildManager.ExecutePreAppStart() +172
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1151
[HttpException (0x80004005): The pre-application start initialization method Start on type Microsoft.Web.Helpers.PreApplicationStartCode threw an exception with the following error message: Attempt by security transparent method 'Microsoft.Web.Helpers.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed..]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12618980
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12458597
This allowed the packages to uninstall and reinstall without impacting their dependencies. It automatically updated the webconfig and bits started working again.
It could be worth removing your Microsoft.Web.Helpers dll and then trying the above to see if it resolves the issue for you.
I got it working. I removed the Microsoft.web.helpers.dll from the BIN directory and also from the "web.config" file. I had to remove the "Using web helper reference" from the web.config in the Views and Partial Views directory to get things up and running.
Upgrading to Umbraco 7.35 Error
I am trying to do a manual upgrade to 7.35. The backoffice is working just fine but the front end is not. I had to add back the Microsoft.web.helpers.dll because Umbraco complained that it did not exist. When I add it back I get this error. Any thoughts?
Attempt by security transparent method 'Microsoft.Web.Helpers.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed.
Hi Jeff,
When I did an upgrade and found that it was reporting Microsoft.Web.Helpers was missing I fixed it by running the following Nuget Commands:
This allowed the packages to uninstall and reinstall without impacting their dependencies. It automatically updated the webconfig and bits started working again.
It could be worth removing your Microsoft.Web.Helpers dll and then trying the above to see if it resolves the issue for you.
Unfortunately I cannot use NUGET for this instance.
Hmm, that is a shame.
Can you confirm that in your webconfig files you see the following bits (they may or may not be next to each other):
I do Nik, have all those entries
Thanks for your assistance Nik. I think you pointed me in the right direction.
No problem, there have been a few of these errors with upgrading to 7.3.5 which all seem to relate around the same files.
I got it working. I removed the Microsoft.web.helpers.dll from the BIN directory and also from the "web.config" file. I had to remove the "Using web helper reference" from the web.config in the Views and Partial Views directory to get things up and running.
could you mark your answer as correct?
Removing the Microsoft.web.helpers.dll from the BIN directory helped me also. Thanks a lot
/Alex
Removing the Microsoft.web.helpers.dll from the bin also worked for me.
Thanks
Darren
is working on a reply...