2016-12-30 220 views
0

我正在開發一個mvc c#episerver網站。該網站在IIS 10/Win 10上加載了一個專用應用程序池等。在對代碼和與佈局有關的具體.cshtml做了一些更改後,我在所有共享該佈局的頁面上收到以下錯誤。IIS 10無法解析.cshtml文件

The following file could not be rendered because its extension ".cshtml" might not be supported: "~/Views/Shared/Layouts/_Root.cshtml".

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The following file could not be rendered because its extension ".cshtml" might not be supported: "~/Views/Shared/Layouts/_Root.cshtml".

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

所有其他具有不同佈局的頁面都可以正常工作。此外,如果我加載與Visual Studio iisexpress的網站工作正常。

任何人都有任何想法,爲什麼我的IIS嚇壞了?

回答

1

According to this的解決辦法是清除asp.net緩存文件

刪除的文件的文件夾內:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\

+0

我莫名其妙地沒有檢查到該解決方案,即使我在我的谷歌搜索結果在其絆倒。謝謝! – Agraell