出版从视觉工作室到Azure的ASP.NET核心应用程序不用手动停止应用程序就无法正常工作
我在Visual Studio中有一个ASP.NET Core 6网站项目。该网站需要发布到Azure。我通过右键单击项目,选择“发布”,转到发布页面并再次按“发布”来做到这一点。
当我的应用是ASP.NET WebForms应用程序时,这曾经完美地工作。由于我转换为使用ASP.NET Core(使用VS提供的模板新的新从头开始),因此发布不再有效。
我必须手动停止运行站点,然后“发布”,最后重新启动该站点。
在没有手动步骤的情况下,我该如何使这项工作,就像以前在WebForms中使用的那样?
I have an ASP.NET Core 6 website project in Visual Studio. The site needs to be published to 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. Since I transformed to using ASP.NET Core (new from scratch, using the VS supplied template), publishing no longer works.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
提示
请将您的VS2022升级到最新版本。
请确认您当前正在使用的WebApp的堆栈。
Azure应用程序服务在沙盒环境中运行,默认情况下以多种语言支持WebApps,例如Nodejs,Python,Java ...
但是我们不能排除由于此问题而可能出现此问题这个堆栈。我的建议是您可以在Kudu网站中添加扩展名。请不要忘记重新启动该网站。
这样做之后,沙盒环境可以支持ASP.NET和ASP.NET核心。
如果此解决方案不起作用,则可以尝试使用GitHub。
Tips
Please upgrade your VS2022 to the latest version.
Please confirm the stack of the webapp you are currently using.
The Azure app service runs in a sandbox environment and supports webapps in many languages by default, such as 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. Please don't forget to restart the site.
After doing this, the sandbox environment can support both Asp.Net and Asp.Net Core.
If this solution not works, you can try to use github.