Copied to clipboard

Flag this post as spam?

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


  • E.J. Brennan 73 posts 114 karma points
    Feb 17, 2011 @ 16:24
    E.J. Brennan
    0

    Cannot save razor files without forcing the ignoring of errors.

    I wonder if anyone else is having this same problem. I am running 4.6.1, and am able to use the Razor scripts, but 9 out of 10 times if I try to save the script from the editor, Umbraco complains about a long list of errors. However, if I tell it to "ignore errors on save" ,the script still works. 

    I am only using trivial razor scripts (i.e. hello world) so far, but the error often complains about "does not contain definition for xxxx", where xxxx is some property that I am not even using.

    Here is an example:

    Razor Macro Engine

     

    An unknown error occured while rendering the following code:

    Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'umbraco.MacroEngines.DynamicNode' does not contain a definition for 'bodyText' 
    at CallSite.Target(Closure , CallSite , Object ) 
    at RazorEngine.Dynamic.addeececfd.Execute() 
    at RazorEngine.Templating.TemplateService.Parse[T](String template, T model, String name) 
    at RazorEngine.Razor.Parse[T](String template, T model, String name) 
    at umbraco.MacroEngines.RazorEngine.GetResult(String cacheIdentifier, String template, INode currentPage, String& result)

    Your Razor template:

    <div>
    <p>Hello, E.J. Brennan</p>
    <p>Current Page: @Model.Name<p>
    </div>

    Is this a bug in my setup? Anyone seen a similar issue?

Please Sign in or register to post replies

Write your reply to:

Draft