I'm trying to use ASP.NET WebPages to make sense of an existing site which uses static .html files (about 500 of them). Unfortunately, my SEO person is requiring that the site maintains its existing directory / filenames, so I need to use .html.
After finding this example, I tried adding the extension in web.config
under compilation/buildProviders/
as:
<add extension=".html" type="System.Web.WebPages.Razor.RazorBuildProvider"/>
And adding an Assembly as well:
<add assembly="System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
This still doesn't render the page. It is simply output as source. I also created a Global.asax
at the root of the project and added this under Application_Start()
:
System.Web.Razor.RazorCodeLanguage.Languages.Add(
"html", new System.Web.Razor.CSharpRazorCodeLanguage());
System.Web.WebPages.WebPageHttpHandler.RegisterExtension("html");
Still had no effect. Unfortunately, I'm drawing a blank on Google.