I realize that there is a new version (4.7) of Umbraco coming out, but I need to publish a macro for a running site tonight. This is the first time that I have used Razor, so I'm sure I'm doing something wrong, but I have the following error message:
An unknown error occured while rendering the following code:
System.NullReferenceException: Object reference not set to an instance of an object. at RazorEngine.Dynamic.baeffbebc.Execute() at RazorEngine.Templating.TemplateService.Parse[T](String template, T model, String name) at umbraco.MacroEngines.RazorEngine.GetResult(String cacheIdentifier, String template, INode currentPage, String& result)
The problem has been solved. Apparently a previous error was cached by Umbraco and the cache was not being invalidated despite making changes to the script. I'm pretty sure this is a bug in the way Umbraco caches Razor macros. I solved the problem by recycling the Application Pool in IIS.
Razor Error
I realize that there is a new version (4.7) of Umbraco coming out, but I need to publish a macro for a running site tonight. This is the first time that I have used Razor, so I'm sure I'm doing something wrong, but I have the following error message:
An unknown error occured while rendering the following code:
System.NullReferenceException: Object reference not set to an instance of an object. at RazorEngine.Dynamic.baeffbebc.Execute() at RazorEngine.Templating.TemplateService.Parse[T](String template, T model, String name) at umbraco.MacroEngines.RazorEngine.GetResult(String cacheIdentifier, String template, INode currentPage, String& result)
My macro looks like this:
The problem has been solved. Apparently a previous error was cached by Umbraco and the cache was not being invalidated despite making changes to the script. I'm pretty sure this is a bug in the way Umbraco caches Razor macros. I solved the problem by recycling the Application Pool in IIS.
Thanks!
is working on a reply...