By default when you use the Durandal MVC template, your views should be created as plain html files.
But what if you want to use ASP.NET MVC Razor files(.cshtml) instead? This is perfectly possible but requires some configuration work from you:
First, let’s switch the Durandal view extension from .html(the default) to .cshtml. Open up the main.js file and set the viewExtension property on the viewEngine object:
The next step is to create a generic controller that will serve .cshtml files:
And of course, don’t forget to add a route that matches this controller:
As a last step copy the web.config file from Views/web.config to /App/views/web.config (so Razor views work in this location):