Visual Studio 2010 does not install .CSHTML (Razor viewer) as content

I am trying to deploy an ASP.NET MVC 3 Beta application on my hosting. It supports all the necessary technologies, and through the trail and error I set the necessary links Copy Localto True. Then I received an error message that my application could not find the view. He listed the .cshtml files that he tried. I had these files in my project, but they were not deployed. I found that Visual Studio 2010 does not install .cshtml files property of Build Actionboth Content, as well as for the .aspx file.

Is there a way to make Visual Studio automatically install .cshtml as Content, or will I need to install it manually for every Razor View that I add?

+5
source share
2 answers

Waiting for the final release, which will have full integration of Visual Studio and Intellisense with the Razor view engine, you can check out this blog post and especially the section: Changing the default assembly action for a file type.

+3
source

My team also faced this problem. Despite the fact that we all know about gotcha, it is too easy to forget to change the action of the assembly, and as a result you will end up with a runtime error.

Connect, . , , .

http://connect.microsoft.com/VisualStudio/feedback/details/619539/mvc3-razor-views-and-partial-views-cshtml-are-not-marked-as-content

+2

All Articles