Welcome to the navigation

Ut duis dolore fugiat dolor cillum mollit do laborum, in veniam, occaecat anim eu qui aliquip consequat, ipsum cupidatat ad elit, nostrud non proident, ea. Reprehenderit veniam, quis ut adipisicing ipsum in magna ut commodo aliqua, laborum, eiusmod duis velit cupidatat ullamco excepteur labore in et sunt aute elit, proident

Yeah, this will be replaced... But please enjoy the search!

YSOD: The type or namespace name 'RenderMacro' does not exist in the namespace 'Umbraco'

Categories Tags

So Umbraco blew up when you tried to insert a macro on a razor page using some code like this @Umbraco.RenderMacro? You are probably missing the UmbracoContext in your view. 

My code was looking like this

@Umbraco.RenderMacro("FormsRenderForm", new { FormGuid = "1203e391-30bb-4ffc-8fe6-1785d609db92" })

And the error was as shown in the image above. Since I use highly specialized views with custom contructors and my own ViewModels I don't have the Umbraco Context exposed in my views per default. Instead I fetch the Context singleton when needed.

@{
    // create your own umbraco context
    var umbraco = new UmbracoHelper(UmbracoContext.Current);
}
@umbraco.RenderMacro("FormsRenderForm", new { FormGuid = "1203e391-30bb-4ffc-8fe6-1785d609db92" })

Success

Cheers

Please note that this portal is a BETA site , I will continuously improve all functionality and performance during the coming weeks / the author