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?
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.