【ASP.NET CORE】從IIS開啟.Net Core網站出現Error.An error occurred while processing your request.

.NET Core網站發佈到IIS後,若開啟網站出現

Error.

An error occurred while processing your request.

Development Mode

Swapping to Development environment will display more detailed information about the error that occurred.

The Development environment shouldn’t be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app.

出現此畫面是因為程式出現錯誤,但非開發環境
因此無法顯示錯誤訊息給你看

可以在IIS網站的檔案,找到web.config加上這段(記得改結尾)

<environmentVariables>
<environmentVariable name=”ASPNETCORE_ENVIRONMENT” value=”Development” />
</environmentVariables>


探索更多來自 宸宸知識庫 的內容

訂閱後即可透過電子郵件收到最新文章。

Comments

No comments yet. Why don’t you start the discussion?

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *