Copied to clipboard

Flag this post as spam?

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


  • Allan Hawkey 232 posts 303 karma points
    Nov 24, 2012 @ 19:46
    Allan Hawkey
    0

    Error with all razor scripts in 4.11.0

     

    I've just upgraded a site to 4.11.0 from 4.10.1 and all my razor scripts now give errors - mainly from 2 packages, uBlogsy and CultivContactForm.

    On the website, I see (for example):  Error loading MacroEngine script (file: CultivContactForm.cshtml)

    In the back office, I see:

    Server Error in '/' Application.

    The extension for the current file 'macroScripts\CultivContactForm.cshtml' is not of an allowed type for this editor. This is typically controlled from either the installed MacroEngines or based on configuration in /config/umbracoSettings.config

    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: Umbraco.Core.IO.FileSecurityException: The extension for the current file 'macroScripts\CultivContactForm.cshtml' is not of an allowed type for this editor. This is typically controlled from either the installed MacroEngines or based on configuration in /config/umbracoSettings.config

    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:

    [FileSecurityException: The extension for the current file 'macroScripts\CultivContactForm.cshtml' is not of an allowed type for this editor. This is typically controlled from either the installed MacroEngines or based on configuration in /config/umbracoSettings.config]
       Umbraco.Core.IO.IOHelper.ValidateFileExtension(String filePath, List`1 validFileExtensions) +244
       umbraco.cms.presentation.developer.editPython.OnInit(EventArgs e) +219
       System.Web.UI.Control.InitRecursive(Control namingContainer) +140
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +480
    

    I'd really appreciate any input on this so I can get the new version live.

    Thanks in advance

    Allan

  • Allan Hawkey 232 posts 303 karma points
    Nov 24, 2012 @ 19:54
    Allan Hawkey
    0

    This seems to be fixable by reverting to the umbraco.MacroEngines dll file from 4.10.1, but hopefully someone will look at what's wrong in the 4.11 version.

  • Milos Turek 2 posts 22 karma points
    Nov 26, 2012 @ 22:55
    Milos Turek
    0

    I have also noticed that I can't create razor scripts at all in 4.11 - my 'Choose a language' combo is empty. Reverting umbraco.MacroEngines didn't help me..

  • James Lau 37 posts 58 karma points
    Nov 27, 2012 @ 07:12
    James Lau
    0

    Similar  problem here.

    Error loading MacroEngine script (file: , Type: ''

    No MacroEngine found for extension 'cshtml'
      at umbraco.cms.businesslogic.macro.MacroEngineFactory.GetByExtension(String extension)
      at umbraco.macro.loadMacroScript(MacroModel macro)
      at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)

    My masterpage file use 

        <umbraco:Macro Language="cshtml" runat="server">@RenderPage("~/macroscripts/RegisterStyleSheetFile/CurrentCulture.cshtml")</umbraco:Macro>
     

    umbracoSettings.config is

       <templates>
            <useAspNetMasterPages>true</useAspNetMasterPages>
            <defaultRenderingEngine>WebForms</defaultRenderingEngine>
        </templates>
       

    Fixed it after modify umbracoSettings.config, no need to replace umbraco.MacroEngines.dll

                <scriptFileTypes>js,xml,cshtml</scriptFileTypes>
  • Michiel 30 posts 61 karma points
    Nov 27, 2012 @ 12:17
    Michiel
    0

    Changing the umbraco.MacroEngines dll worked for me, but the new file was 1kb bigger than the oldd one.

    Guess there will be a fix soon.

    Still got one macro tho that's not fully cooperating, but that one broke since I've updated from 4.7 to 4.9 and still broken in 4.11. Could be my own bad code :o. Was some bad code, forgot the to uppercase some letters, so fixed that.

     

  • kristofer månsson 1 post 22 karma points
    Nov 27, 2012 @ 14:54
    kristofer månsson
    1

    Seems (for me atlleast) like the file-extension check has been implemented.

    I found this in umbracoSettings.config witch seems odd since my Razor-scripts is .cshtml

    <scriptFileTypes>js,xml</scriptFileTypes

    So I added it and looks like it works. Like this:

    <scriptFileTypes>js,xml,cshtml</scriptFileTypes
  • Steve Farron 1 post 21 karma points
    Nov 27, 2012 @ 16:52
    Steve Farron
    0

    It appears the umbraco.MacroEngines namespace isn't referenced correctly in 4.11.0.  Try adding the following line to Global.asax:

     

    Then, restart your Umbraco application pool in IIS.

    Just touch(open, resave) the Global.asax file.

  • Garret 69 posts 309 karma points
    Nov 27, 2012 @ 20:15
    Garret
    0

    Similar problem. Can't create script under "Scripting Files", choose a language is indeed empty.
    Added umbraco.MacroEngines.dll from 4.10.0 and added cshtml to <scriptFileTypes>js,xml</scriptFileTypes>

    Doing something else wrong, or need to wait for a bugfix?

  • Milos Turek 2 posts 22 karma points
    Nov 27, 2012 @ 21:03
    Milos Turek
    0

    I got it working, but I'm not really sure what helped. I tried:

    1) referencing <%@ Import Namespace="umbraco.MacroEngines" %> to global.asax

    2) removing umraco/create/DLRScripting.ascx (the dialog for selecting script type) and putting it back

    3) after installing log manager to check if there is some error i noticed that the script templates and script types are back..

    Now i removed reference from global.asax and it still works so maybe simply recycling the pool would do the magic

  • David Hanson 3 posts 23 karma points
    Dec 12, 2012 @ 19:57
    David Hanson
    0

    The "Choose a language" dropdown box is also empty for me. Inline C#/Razor scripts also fail inside of my templates indicating No MacroEngine found for extension 'cshtml' in the Umbraco trace log.  Please see this topic for what I did to solve both issues:

    http://our.umbraco.org/forum/developers/razor/36894-No-MacroEngine-found-for-extension-'cshtml'

    David

  • Vadim 4 posts 25 karma points
    Nov 25, 2013 @ 07:40
    Vadim
    0

    I have the same problem with umbraco 4.11.0

    I did what "kristofer månsson" posted and it work for me like charm !

    You have to allow razor (cshtml) file to be listed as script file, so after you will add in umbracoSettings.config file the cshtml like this:

    <scriptFileTypes>js,xml,cshtml</scriptFileTypes>

    After this change all the razor files will work and in "Choose a language:" will appear all languages ​​including razor

Please Sign in or register to post replies

Write your reply to:

Draft