asp.net - 将asp.net core应用程序部署到azure后出错

标签 asp.net azure asp.net-core

首次将我的 asp.net core 应用程序部署到 azure 并运行它后,出现以下错误:

Error. An error occurred while processing your request. Development Mode Swapping to Development environment will display more detailed information about the error that occurred.

Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.

请注意,我在 Visual Studio 中发布时尝试了调试和 Release模式,并确保选择了默认迁移并拥有连接字符串。 如果可能的话,您能告诉我如何启用如图所示的开发模式或进一步解释该错误吗? 谢谢

编辑:根据我收到的建议,我在云资源管理器日志中发现了以下内容:

Msvsmon was unable to start a server named '127.0.0.1:50867'. The following error occurred: An instance of the remote debugger is already running on this computer, or another process is already bound to the specified TCP/IP port.

最佳答案

很明显 - ASP.NET Core 2.0 中仍然出现了一些东西 - 正如 @Techy 所说 - 是在 Azure 中。转到Azure,单击您的Web应用程序 ->“应用程序设置” ->转到“应用程序设置”部分并添加“ASPNETCORE_ENVIRONMENT”和“开发”

Azure Portal

关于asp.net - 将asp.net core应用程序部署到azure后出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40696952/

相关文章:

c# - 更新中间证书后使用 NFe Web 服务

Azure Web 应用程序不使用 GZip 压缩

python - 将 django 应用程序发布到 azure 时出现服务器错误

c# - Azure .NET MVC 核心应用程序 : User not being redirected upon form submission

c# - 如何从 ActionExecutingContext 获取路由模板

asp.net - 单击 ASP.NET 4.0 应用程序上的任何按钮都没有回发

asp.net - 如何将两个模型传递给一个 View

c# - 如何将文件从 Angular 上传到 ASP.NET Core Web API

asp.net - Paypal 整合问题

ASP.NET MVC - 要从外部 Controller 或 View 确定的内容的绝对 URL