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 1152
别跟我提以往
别跟我提以往 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:49

    This may not be your exact issue, but I have had this happen for a couple reasons:

    1. Incorrect Framework on Server: Make sure the target framework of the project is supported by the server. Just changing the targetFramework attribute of the compilation element may not be enough as the DLLs for your project may be compiled against the 4.5 framework.

    2. Incorrect Framework of Application Pool: This can also happen if your application pool is not using the right .Net CLR version. Make sure it is using the 4.0 instead of 2.0

提交回复
热议问题