Copied to clipboard

Flag this post as spam?

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


  • David Hanson 3 posts 23 karma points
    Dec 11, 2012 @ 21:24
    David Hanson
    0

    No MacroEngine found for extension 'cshtml'

    Greetings,

    Hoping someone can help.

    I added a basic inline Razor (C#) macro to my template and the page is now having problems rendering and is showing this error in the trace log:

    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)

    Here is the macro in my template:

    <umbraco:Macro runat="server" language="cshtml">
    <h1>Hello, world... from Macro</h1>
    </umbraco:Macro>

    I am running Umbraco 4.11.1.

    Any help you can provide will be greatly appreciated.

    Thank you,

    David

     

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

    Fixed the problem.

    This appears to be a bug with Umbraco 4.11.1 as I followed the standard setup and simply added the Business Starter Kit.  Here is what I did to solve the problem:

    1. edited config\umbracoSettings.config and changed js,xmlto js,xml,cshtml
    2. touched \web.config (opened, added a space, saved, removed space, re-saved)
    3. touched \global.asax (opened, added a space, saved, removed space, re-saved)
    This solved the issue with my inline C#/Razor script running inside a template.  This also fixed another problem that caused the "Choose a language" dropdown to be empty when creating a new script file under "Umbraco > Developer > Scripting Files > Create".
    Hopefully this information may be of some help to you.
    David
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies