Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jeff mayer 122 posts 200 karma points
    Jan 28, 2016 @ 14:25
    jeff mayer
    1

    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.

    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
    
  • Nik 1591 posts 7148 karma points MVP 6x c-trib
    Jan 28, 2016 @ 14:31
    Nik
    0

    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:

    uninstall-package Microsoft.AspNet.WebApi -Force
    
    Install-package Microsoft.AspNet.WebApi -Version 5.2.3
    

    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.

  • jeff mayer 122 posts 200 karma points
    Jan 28, 2016 @ 14:32
    jeff mayer
    0

    Unfortunately I cannot use NUGET for this instance.

  • Nik 1591 posts 7148 karma points MVP 6x c-trib
    Jan 28, 2016 @ 14:39
    Nik
    0

    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):

    <dependentAssembly>
            <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
    </dependentAssembly>
    
    <dependentAssembly>
        <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
    
    <dependentAssembly>
            <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
          </dependentAssembly>
    
  • jeff mayer 122 posts 200 karma points
    Jan 28, 2016 @ 14:51
    jeff mayer
    0

    I do Nik, have all those entries

  • jeff mayer 122 posts 200 karma points
    Jan 28, 2016 @ 20:15
    jeff mayer
    0

    Thanks for your assistance Nik. I think you pointed me in the right direction.

  • Nik 1591 posts 7148 karma points MVP 6x c-trib
    Jan 28, 2016 @ 21:42
    Nik
    0

    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.

  • jeff mayer 122 posts 200 karma points
    Jan 28, 2016 @ 20:09
    jeff mayer
    8

    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.

  • Tobias Lopez 64 posts 210 karma points
    Feb 29, 2016 @ 15:00
    Tobias Lopez
    0

    could you mark your answer as correct?

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    Nov 03, 2016 @ 18:00
    Alex Skrypnyk
    0

    Removing the Microsoft.web.helpers.dll from the BIN directory helped me also. Thanks a lot

    /Alex

  • Darren Eccles 59 posts 298 karma points
    Jun 13, 2017 @ 09:36
    Darren Eccles
    0

    Removing the Microsoft.web.helpers.dll from the bin also worked for me.

    Thanks

    Darren

Please Sign in or register to post replies

Write your reply to:

Draft