C# and Razor - The type of page you have requested is not served because it has been explicitly forbidden. The extension '.cshtml' may be incorrect

后端 未结 6 1110
别跟我提以往
别跟我提以往 2021-01-02 01:09

I have looked through other posts but none seem to answer what I need.

  • I created an empty site in WebMatrix (ASP.NET)
  • I opened that site in VWD 2013
6条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-02 01:58

    In my case I set webpages:Enabled to true under appSettings:

    
      
       
    

    According to post: what is the function of webpages:Enabled in MVC 3 web.config, this prevents files in the Views folder from being directly accessible from a web browser.

提交回复
热议问题