将asp.net核心应用程序部署到Azure后出现错误 [英] Error after deploying asp.net core app to azure

查看:190
本文介绍了将asp.net核心应用程序部署到Azure后出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将我的asp.net核心应用程序首次部署为Azure并运行它之后,出现以下错误:

After deploying my asp.net core app to azure for the first time and ran it, I got the following error:

错误.处理您的请求时发生错误.发展 模式切换到开发环境将显示更多详细信息 有关发生的错误的信息.

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

不应在已部署的环境中启用开发环境 应用程序,因为它可能会导致来自 异常显示给最终用户.对于本地调试, 可以通过设置开发环境来启用 ASPNETCORE_ENVIRONMENT环境变量为Development,并且 重新启动应用程序.

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中进行发布时,我尝试了调试和发布模式,并确保选择了默认迁移并具有连接字符串. 如果可能的话,您能告诉我如何启用如图所示的开发模式或进一步解释该错误吗? 谢谢

Please note that I tried debug and release mode when publishing in visual studio and I made sure that I chose the default migration and have the connection string as well. If possible, can you tell me how to enable development mode as shown or explain the error further? Thank you

根据我收到的建议,我在Cloud Explorer日志中发现了以下内容:

As per the suggestion I received I found the following in cloud explorer log:

Msvsmon无法启动名为"127.0.0.1:50867"的服务器.这 发生以下错误:远程调试器的一个实例是 已经在这台计算机上运行,​​或者其他进程已经绑定 到指定的TCP/IP端口.

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"和开发"

Just so it's clear - still something that comes up in ASP.NET Core 2.0 - and as @Techy stated - is in Azure. Go to Azure, click on your Web App –> "Applications Settings" –> go down to the "App Settings" section and add the "ASPNETCORE_ENVIRONMENT" and "Development"

这篇关于将asp.net核心应用程序部署到Azure后出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆