![](/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.