简体   繁体   English

如果不手动停止应用程序,则无法将 ASP.NET Core 应用程序从 Visual Studio 发布到 Azure

[英]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.

相关问题 从 Visual Studio 2019 将 ASP.NET Core 3.1 站点发布到 Azure 时出错 - Error publishing an ASP.NET Core 3.1 site to Azure from Visual Studio 2019 使用Visual Studio 2017在Azure应用服务中发布ASP.NET应用程序后获取HTTP错误404 - Getting HTTP ERROR 404 after publishing ASP.NET application in Azure App Service with Visual Studio 2017 .NET Core应用程序在Visual Studio中的独立发布 - .NET Core app standalone publishing in Visual Studio asp.net 内核在 Visual Studio 19 上不起作用 - asp.net core does not work on Visual Studio 19 ASP.Net Core应用程序可在Visual Studio中运行,但不能与dotnet运行 - ASP.Net Core app works in visual studio but not with dotnet run Compliación:Locale must be of the form - 将 asp.net core web 应用程序发布到 IIS 或 Azure 时出错 - Compliación:Locale must be of the form - Error when publishing asp.net core web app to IIS or Azure Visual Studio 2017 ASP.Net发布自包含的点网核心应用程序 - Visual Studio 2017 ASP.Net Publish Self-Contained Dot Net Core App "从 Visual Studio Windows 发布 Xamarin IOS 应用程序的存档不起作用" - archive for Publishing Xamarin IOS App from Visual studio windows does not work 通过Visual Studio的ASP.NET MVC核心部署不起作用 - ASP.NET MVC Core Deployment via Visual Studio does not work 为什么在 Visual Studio 中结束调试后我的 docker 容器 ASP.NET 核心应用程序不可用 - why is my docker container ASP.NET core app not available after ending debugging in Visual Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM