How does one create a .cshtml page in an ASP.NET web application? The option to choose Razor is obvious when using MVC - it appears when adding a view. But I can't seem to figure out how to accomplish this in a plain ASP.NET Web Application. Is it even possible?
1 Answer
Create an HTML file and rename it to CSHTML.
Although Razor pages don't appear in the Add New Item list, they work fine in normal web projects.
4 Comments
Maslow
mine says no compiler is registered for .cshtml
SLaks
@Maslow: You need to install MVC3.
Maslow
it says I have it, it was installed 5 days ago in my programs and features section. version
3.0.20105.0. also Mvc3 Tools update 3.0.20406.0. and finally Asp.net web pages 1.0.20105.0SLaks
Try installing or repairing VS SP1.