I have an MVC 3 app and a view with a single line:
@ModelType String
and this causes a “Syntax error” in Index.vbhtml, with no line or column specified. Research suggests the Razor view engine is not registered, but I have the following in my ~\Views\web.config:
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.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" />
</namespaces>
</pages>
</system.web.webPages.razor>
What am I missing?
Never mind – it appears to be a known issue with MVC3 and VB:
http://aspnet.codeplex.com/workitem/8136