我试图运行.cshtml
文件,但它给了一个错误:web.config文件的根(/)目录
Server Error in '/' Application.
--------------------------------------------------------------------------------
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.cshtml' may be incorrect. Please review the URL below and make sure that it is spelled correctly.
Requested URL: /index.cshtml
所以我搜索的解决方案,我发现我不得不编辑web.config
文件位于根目录(这里是我的网站),但没有像那样的文件,那里只有我创建的index.cshtml
。
我搜索了IIS
和IIS Express
文件夹中的Programs Files\
,但是没有这样的文件?
@Adriano这不是一个MVC网站。这是一个网页网站。 –
您可以添加一个web.config文件,但您可能需要选择选项以在“添加文件”对话框中显示所有文件类型。此外,GmG在他的回复中提供了一些关于您将来应该使用的模板的相关指导。 –