If I create a new WebRazorHostFactory like this:
namespace Test
{
public class TestMvcWebRazorHostFactory : WebRazorHostFactory
{
public override WebPageRazorHost CreateHost(string virtualPath, string physicalPath)
{
WebPageRazorHost host = base.CreateHost(virtualPath, physicalPath);
if (!host.IsSpecialPage)
{
return new MvcWebPageRazorHost(virtualPath, physicalPath);
}
return host;
}
}
}
and reference it in ~/Views/Web.config like this:
<system.web.webPages.razor>
<host factoryType="Test.TestMvcWebRazorHostFactory" />
...
</system.web.webPages.razor>
the intellisense in my view files no longer recognize the "model" and "TextBoxFor" in:
@model Test.Models.Person
<div>
@this.Html.TextBoxFor( x => x.Name )
</div>
How do I make a new WebRazorHostFactory that doesn't mess up the intellisense in the view files?
In the MvcWebPageRazorHost I see they run a function "GetRidOfNamespace("System.Web.WebPages.Html");", but I'm not sure if this is the problem? I have tried to write a different class that does the same thing as MvcWebPageRazorHost without this function and it seems to have no effect. Thanks.