Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SauliusSun/5c6f3dd573f41347ac15 to your computer and use it in GitHub Desktop.
Save SauliusSun/5c6f3dd573f41347ac15 to your computer and use it in GitHub Desktop.
ASP.NET MVC register only Razor view engine
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RouteConfig.RegisterRoutes(RouteTable.Routes);
// remove all view engines registered in application
ViewEngines.Engines.Clear();
// add Razor view engine
ViewEngines.Engines.Add(new RazorViewEngine());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment