This project is read-only.

visual studio 2010 doesn't recognise .cshtml

Topics: General
Dec 11, 2011 at 12:55 PM

i am unable to add a .cshtml in visual studio 2010 to create a new layout for a theme. i have mvc3 and the tools update installed. i was able to add the .cshtml file in webmatrix but in vs2010, the .cshtml file doesn't show up in the views folder. any ideas?

Dec 11, 2011 at 12:59 PM


that is vs question, not orchard

Dec 11, 2011 at 1:03 PM

oh, maybe u can try use .txt , then change to .cshtml

Dec 11, 2011 at 1:19 PM

ok i'll post in forums then

Dec 11, 2011 at 1:24 PM

would it matter if i said that i can add a view if its a mvc3 project but it doesn't work for this theme project i created through the command line.

Dec 11, 2011 at 8:38 PM
Edited Dec 11, 2011 at 8:38 PM

This is normal (in VWD 2010 for me). Because Orchard has so much custom stuff in its Web.config, some of the normal MVC helpers in VS don't work properly (and possibly also so things will still work in case you don't have the MVC tooling installed). I believe it's possible to enable them by adding the usual MVC entries in Web.config, I recall a thread on here at some point about it.

Still, just because .cshtml isn't in the New menu doesn't mean you can't create them - just copy and rename another .cshtml or just create a text file and rename the extension, you'll still get cshtml editing and intellisense.