None
None

Reputation: 5670

Can not get Razor to work in 4.7

I create a new Razor scripting file. just a test string in there (no actual razor code), then put the macro in a template and it displays:

Error loading MacroEngine script (file: test.razor)

Upvotes: 0

Views: 1708

Answers (1)

marapet
marapet

Reputation: 56566

Usually, the macro scripts have the extension .cshtml (not .razor) and are placed in the /macroScripts folder.

The macros usually look like this:

@inherits umbraco.MacroEngines.DynamicNodeContext
@{
    // razor & html
    <div>A simple div</div>
}

You may try by simply putting a @{ ... } around your test string (as well as renaming the extension to cshtml).

Upvotes: 3

Related Questions