“This type of page is not served.” error when trying to browse on *.cshtml files

后端 未结 4 1756
礼貌的吻别
礼貌的吻别 2020-12-08 09:23

I just create a new MVC 4 Web API project, and create a new .cshtml file, containing very simple HTML:





    &         


        
4条回答
  •  轮回少年
    2020-12-08 10:07

    If you have enabled Web Pages and you have verified that the .NET version is valid then your problem is most likely that the IIS server does not have the razor binaries available to be shared across all sites. To fix it you should ensure you've included the mvc binaries in your /bin folder. This link explains it very well:
    http://www.codeproject.com/Answers/437259/his-type-of-page-is-not-served-CSHTML-how-to-serve#answer1

提交回复
热议问题