![](/img/trans.png)
[英]Problems publishing a ASP.NET Core 3.1 project to azure Getting a message “Your account is at risk”
[英]Publishing to IIS ASP.NET Core 3.1
我有一個發布到 Windows 服務器的 ASP.NET 3.1 項目。 當我在我的計算機上本地運行該項目時,它工作正常; 但是,當我遠程桌面進入該 Windows 服務器時,我在網絡選項卡中收到 500 錯誤和以下錯誤:
我在 Launch.json 文件中將環境變量更改為 Development,但仍然收到相同的錯誤
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
請檢查 ASPNETCORE_ENVIRONMENT 變量的值。 您必須將此環境變量設置為“生產”(或開發以外的其他環境)。
否則,您可以像這樣更新 web.config:
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\Application.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false">
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" />
</environmentVariables>
</aspNetCore>
</system.webServer>
</configuration>
有關更多詳細信息,請參閱此帖子。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.