Using WebMatrix and Visial Studio 2010 on a Razor project

Posted by Terrence Koehn on Stack Overflow See other posts from Stack Overflow or by Terrence Koehn
Published on 2011-05-19T19:43:53Z Indexed on 2012/03/22 23:29 UTC
Read the original article Hit count: 278

Filed under:
|

I am having problems using both WebMatrix and VS on a Razor project. I have downloaded and installed all updates from the official ASP.net web site. After getting the project to compile in VS I get the following error:

"The type of page you have requested is not served because it has been explicitly forbidden. The extension '.cshtml' may be incorrect."

Now when I open the project in WebMatrix I receive the same error. I can open/run other projects in WebMatrix without errors so apparently VS changed some configuration in my project?

Fortunately I have found a work around but the problem is still not solved.

1) Create a new empty folder for site.

2) Copy contents of folder from failing site.

3) In WebMatrix use option "Site From Folder".

Once I have the site up and running with the above steps I can delete the original folder, then rename the new folder (which is now working) to the orig name and the site will stop working again. There is some setting on my system tied to the original folder name that is stopping cshtml files from being served. What/Where is that setting?

Thanks, Terrence Koehn

© Stack Overflow or respective owner

Related posts about visual-studio-2010

Related posts about Razor