[英]Publishing ASP.NET Core app from Visual Studio to Azure does not work without manually halting the app
I have an ASP.NET Core 6 website project in Visual Studio.我在 Visual Studio 中有一个 ASP.NET Core 6 网站项目。 The site needs to be published to Azure.该站点需要发布到 Azure。 I do this by right-clicking on the project, selecting "Publish", get to the publish page and press "Publish" again.为此,我右键单击项目,选择“发布”,进入发布页面并再次按“发布”。
This used to work flawlessly when my app was an ASP.NET Webforms app.当我的应用程序是 ASP.NET Webforms 应用程序时,这曾经完美地工作。 Since I transformed to using ASP.NET Core (new from scratch, using the VS supplied template), publishing no longer works.由于我转换为使用 ASP.NET Core(从头开始,使用 VS 提供的模板),发布不再有效。
I have to manually stop the running site, then "Publish", and finally restart the site.我必须手动停止正在运行的站点,然后“发布”,最后重新启动站点。
How do I make this work without the manual step, like this used to work in webforms?我如何在没有手动步骤的情况下完成这项工作,就像以前在网络表单中工作一样?
Tips提示
Please upgrade your VS2022 to the latest version.请将您的 VS2022 升级到最新版本。
Please confirm the stack of the webapp you are currently using.请确认您当前使用的 webapp 的堆栈。
The Azure app service runs in a sandbox environment and supports webapps in many languages by default, such as nodejs, python, java... Azure 应用服务运行在沙盒环境中,默认支持多种语言的 webapp,例如 nodejs、python、java...
But we can't rule out that this problem may occur because of this stack.但是我们不能排除这个问题可能是因为这个堆栈。 My suggestion is that you can add an extension in kudu site.我的建议是您可以在 kudu 站点中添加扩展程序。 Please don't forget to restart the site.请不要忘记重新启动网站。
After doing this, the sandbox environment can support both Asp.Net and Asp.Net Core.完成此操作后,沙盒环境可以同时支持 Asp.Net 和 Asp.Net Core。
If this solution not works, you can try to use github.如果此解决方案不起作用,您可以尝试使用 github。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.