.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>
探索更多來自 宸宸知識庫 的內容
訂閱後即可透過電子郵件收到最新文章。