I'm having a problem with RazorGenerator: it can't compile views that uses my custom helper:
App_Code/ViewHelper.cshtml
@helper test(System.Web.Mvc.HtmlHelper html)
{
<h4>Test</h4>
}
Views/Test.cshtml
(...)
@ViewHelper.test(this.Html)
(...)
When I try to compile my project I get this error for Test.cshtml:
The name 'ViewHelpers' does not exist in the current context
I tried adding various namespaces to my Views/web.config file:
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.Optimization" />
<add namespace="MyProject" />
<add namespace="Kendo.Mvc.UI" />
<add namespace="MvcSiteMapProvider.Web.Html" />
<add namespace="MvcSiteMapProvider.Web.Html.Models" />
</namespaces>
</pages>
</system.web.webPages.razor>
but with no success...
Am I missing some namespace that should be included in this file? If not, is there any other way to make RazorGenerator compile the view? Also, does cshtml helpers even exist in a namespace?