Copied to clipboard

Flag this post as spam?

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


  • Bunnynut 136 posts 318 karma points
    Apr 01, 2014 @ 10:44
    Bunnynut
    0

    Fresh install of Umbraco 7.0.4 does not work

    Im trying to install Umbraco 7.0.4 on a Windows 7 Pro 64 bit machine using Visual Studie 2013 Pro following this guide:
    http://www.systenics.com/blog/setting-up-umbraco-7-in-visual-studio-2013-for-mvc-4-development/

    Everyting seems to go fine, i get no errors during installation. But when i run my application i get the following error:

    Server Error in '/' Application.

    Attempt by security transparent method 'System.Web.Mvc.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.PreApplicationStartCode.Start()' 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 'System.Web.Mvc.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.PreApplicationStartCode.Start()' 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 'System.Web.Mvc.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.PreApplicationStartCode.Start()' failed.]
       System.Web.Mvc.PreApplicationStartCode.Start() +46
       Microsoft.Web.Mvc.ViewEngineFix.PreAppStart() +49
    
    [InvalidOperationException: The pre-application start initialization method PreAppStart on type Microsoft.Web.Mvc.ViewEngineFix threw an exception with the following error message: Attempt by security transparent method 'System.Web.Mvc.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.PreApplicationStartCode.Start()' failed..]
       System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +12969195
       System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +12968904
       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 PreAppStart on type Microsoft.Web.Mvc.ViewEngineFix threw an exception with the following error message: Attempt by security transparent method 'System.Web.Mvc.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.PreApplicationStartCode.Start()' failed..]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12968244
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12807949
    

    I have tried a couple of fixes, like running 'Install-Package -Id Microsoft.AspNet.WebHelpers' from the console. But nothing seems to fix this.

    Can anyone help me?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 01, 2014 @ 10:47
    Jan Skovgaard
    1

    Hi Bunnynut

    How did you setup your installation? And is all the neccesary dependencies in place?

    I usually use webmatrix for doing initial installs on new machines since it makes sure to download all frameworks etc. that Umbraco needs in order to work.

    So perhaps you can download webmatrix and do an installation from here so all necessary dependencies gets installed?

    It's always a good idea to check the installation documentation when something goes unexpectedly wrong.

    Hope this helps.

    /Jan

  • Bunnynut 136 posts 318 karma points
    Apr 01, 2014 @ 11:18
    Bunnynut
    0

    Hi Jan,

    Well in the guide i used it mentioned using Nuget which should simplify the installation.
    So i started an ASP.NET web application project targeting framework 4.5 and installed Umbraco using Nuget.
    When i run the application i get the mentioned error.

    When i check the installation documentation for Nuget installation i see a difference in framework version.
    The guide i mentioned uses 4.5 and the installation document says 4.0.
    I have actually tried both versions but they neither one works.

    I have tested installation through Webmatrix just now, but according to the installation i now have installed Umbraco 6.1.6. and not 7.0.4.
    Can i do an easy upgrade from 6 to 7?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 01, 2014 @ 11:46
    Jan Skovgaard
    1

    Hi Bunnynut

    Ok, unfortunately it seems that there has been some issues installing Umbraco 7.0.x using nuget, but try having a look at the issue tracker http://issues.umbraco.org/issues?q=nuget - In some of those fixed issues reported for 7.0.x you might find the answer to the issue.

    As far as I know all of this should be fixed with the 7.1 release scheduled for thursday though.

    Hope this helps.

    /Jan

  • Bunnynut 136 posts 318 karma points
    Apr 01, 2014 @ 11:51
    Bunnynut
    0

    Thats good to know, i can wait till thursday.

    Thanks for your help!

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 01, 2014 @ 13:22
    Jan Skovgaard
    0

    Hi Bunnynut

    You could perhaps also try out the 7.1RC and see if it works?

    It's placed to the right of the beta download.

    /Jan

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Apr 01, 2014 @ 13:22
    Sebastiaan Janssen
    0

    This error is not something we've encountered before and it looks like it's caused by you setting up a project with MVC 5 (at least that's what I've gathered from the Google results). We do not yet support MVC5, so make sure to use an Empty project type (as covered in the docs) or and MVC4 project type (but I'm not entirely sure that will work out of the box, haven't tested 7.0.4 in a while).

  • Bunnynut 136 posts 318 karma points
    Apr 01, 2014 @ 16:18
    Bunnynut
    0

    I would really like the Nuget thing to work, because that seems like the easiest way to install an Umbraco project.
    So i will try Sebastiaan's suggestion and see if that works, i might have selected MVC 5 by accident.

    So i selected .Net Framework 4 and MVC 4, created an empty site, installed umbraco through Nuget. I now get the following error:
    Could not load types from assembly umbraco, Version=1.0.5161.21058, Culture=neutral, PublicKeyToken=null, errors:
    Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method.  Type: 'Umbraco.Web.Editors.ContentPostValidateAttribute'.  Assembly: 'umbraco, Version=1.0.5161.21058, Culture=neutral, PublicKeyToken=null'.
    Exception: System.TypeLoadException: Could not load type 'System.Web.Http.Controllers.IControllerConfiguration' from assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
    Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method.  Type: 'Umbraco.Web.WebApi.Filters.EnsureUserPermissionForContentAttribute'.  Assembly: 'umbraco, Version=1.0.5161.21058, Culture=neutral, PublicKeyToken=null'.
    Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method.  Type: 'Umbraco.Web.WebApi.Filters.EnsureUserPermissionForMediaAttribute'.  Assembly: 'umbraco, Version=1.0.5161.21058, Culture=neutral, PublicKeyToken=null'.
    Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method.  Type: 'Umbraco.Web.WebApi.Filters.FileUploadCleanupFilterAttribute'.  Assembly: 'umbraco, Version=1.0.5161.21058, Culture=neutral, PublicKeyToken=null'.
    Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method.  Type: 'Umbraco.Web.WebApi.Filters.FilterAllowedOutgoingMediaAttribute'.  Assembly: 'umbraco, Version=1.0.5161.21058, Culture=neutral, PublicKeyToken=null'.
    Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method.  Type: 'Umbraco.Web.WebApi.Filters.FilterAllowedOutgoingMediaAttribute'.  Assembly: 'umbraco, Version=1.0.5161.21058, Culture=neutral, PublicKeyToken=null'.

    I have seen this one before on these forums, but those suggestions do not work for me.
    Using Update-Package Microsoft.AspNet.WebApi -Version 4.0.30506 tells me there are no updates.
    Same goes for
    Update-Package Microsoft.Net.Http -Version 2.0.20710.0

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Apr 01, 2014 @ 17:28
    Sebastiaan Janssen
    0

    Hi Bunnynut,

    I think I've cracked it now, see the comment here if you want to try again with an improved version of the NuGet package: http://issues.umbraco.org/issue/U4-4510#comment=67-13390

    Summary:

    Download the following files put them somewhere like C:\Temp and type the following command:

    Install-Package UmbracoCms -Version 7.1.0-RC3 -Pre -Source C:\Temp https://dl.dropboxusercontent.com/u/3006713/NuGet/UmbracoCms.7.1.0-RC3.nupkg https://dl.dropboxusercontent.com/u/3006713/NuGet/UmbracoCms.Core.7.1.0-RC3.nupkg

    Do NOT select MVC, but Empty. Also DO select .NET 4.5 or .NET 4.5.1, Umbraco 7 does not support .NET 4.0.

  • Bunnynut 136 posts 318 karma points
    Apr 08, 2014 @ 16:14
    Bunnynut
    0

    Hij Sebastiaan,

    Sorry replying this late and thanks for this fix.
    I will try your suggestion and get with you with my findings.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Apr 08, 2014 @ 16:31
    Sebastiaan Janssen
    0

    Oh, make sure to use the latest version though (7.1.1 was just released)

    Documentation here: http://our.umbraco.org/documentation/Installation/install-umbraco-with-nuget

  • Bunnynut 136 posts 318 karma points
    Apr 08, 2014 @ 21:31
    Bunnynut
    0

    Hi Sebastiaan,

    I got it to work using the suggestions you mentioned.

    thanks a lot for your time!

  • Lee McMullen 1 post 21 karma points
    Feb 10, 2015 @ 17:23
    Lee McMullen
    0

    Hi guys,

    old thread I know but I'm now having this same issue. 

    Installed Umbraco via Nuget, followed instructions from: http://our.umbraco.org/documentation/Installation/install-umbraco-with-nuget

    Current Umbraco version installed by Nuget is 7.2.1

    It was working ok at first until I ran update-package to get the latest allowed versions of everything. Now getting the following: 

    Attempt by security transparent method 'Microsoft.Web.Helpers.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed.

     

    I'm going to try and roll back to a point in time pre updating all packages but it's clear there is still an issue somewhere, any ideas welcome.

    Thanks,

    Lee

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Feb 10, 2015 @ 17:32
    Sebastiaan Janssen
    0

    @Lee before you roll back, does this help? http://stackoverflow.com/a/19568376/5018

  • Bipin Kataria 29 posts 60 karma points
    Sep 22, 2015 @ 04:26
    Bipin Kataria
    0

    Quick fix for this one is that, first install Umbraco normally using Nuget package manager. Once installation is done, open the Nuget Package Manager Console and run "Install-Package Microsoft.AspNet.Mvc" command. This will fix all your issues. :)

  • James Wilkinson 15 posts 72 karma points c-trib
    Nov 23, 2015 @ 01:43
    James Wilkinson
    9

    Hi,

    I received this error when performing a manual upgrade from v7.2.4 to v7.3.1.

    I ended up comparing the bin folder from the downloaded v7.3.1 against the upgraded site with the error and found that the download had fewer files. I resolved the issue by deleting the following files from the bin folder (just the dlls will have fixed it, but the pdb's aren't in the 7.3.1 release):

    • ClientDependency.Core.Mvc.pdb
    • ClientDependency.Core.pdb
    • Examine.pdb
    • HtmlAgilityPack.pdb
    • Microsoft.Web.Helpers.dll
    • Microsoft.Web.Mvc.FixedDisplayModes.dll
    • MiniProfiler.pdb
    • WebMatrix.Data.dll
    • WebMatrix.Data.xml
    • WebMatrix.WebData.dll
    • WebMatrix.WebData.xml
  • ecsplendid 6 posts 79 karma points
    May 09, 2016 @ 13:45
    ecsplendid
    2

    Thanks James!

    I hit this one by overwriting an old site with a new one from my local box, and as you say must have resulted in some "orphan" assembly(ies) in the /bin which were still being loaded into the app domain and causing this error. I just deleted the bin and copied my fresh local copy up to the server and happy days. Cheers.

  • Gerard 20 posts 77 karma points
    Nov 28, 2015 @ 20:56
    Gerard
    3

    Same problem here after upgrading 7.2.1 to 7.3.2.

    Thanks to James Wilkinson (see post above) I could fix this by removing Microsoft.Web.Helpers.dll and Microsoft.Web.Mvc.FixedDisplayModes.dll from the bin folder. The other files mentioned by James where not in my bin.

    Thanks James!!

    BTW: No VS and so no Nu-Get involved, I always do manual installs.

  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    Apr 24, 2016 @ 11:36
    Markus Johansson
    2

    Just removing "Microsoft.Web.Helpers.dll" did the trick for me! =D

    // m

  • Craig100 1136 posts 2523 karma points c-trib
    Feb 13, 2016 @ 11:45
    Craig100
    0

    Thanks Gerard & James. I had same problem upgrading from 7.1.2 to 7.4 manually.

  • MrFlo 159 posts 403 karma points
    Jul 23, 2016 @ 14:51
    MrFlo
    0

    Thanks Markus! Just removing "Microsoft.Web.Helpers.dll" did the trick for me too!

Please Sign in or register to post replies

Write your reply to:

Draft