0
votes

I am using Visual Studio 2022 to deploy a sample .net core 6.0 app to Azure. I have the Resource group and App service plan ready. I right clicked the project in VS and created a publish profile. There are no build errors. When I click publish, I get the following error.

Web deployment task failed. (The type initializer for 'Microsoft.Web.Deployment.DeploymentManager' threw an exception.)

Publish has encountered an error. Build failed. Check the Output window for more details.

A diagnostic log has been written to the following location: "C:\Users\PS\AppData\Local\Temp\tmp7641.tmp"

Content of this tmp file are as follows System.AggregateException: One or more errors occurred. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details. --- End of inner exception stack trace --- ---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.<---

Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.

I have cleaned the solution, restarted VS, but that didnt help.

The error message is not very helpful. Can someone give some pointers? Thank you.

1

1 Answers

0
votes

I attempted to reproduce the problem, but everything worked well from my end by following the instructions below. To begin, we installed Visual Studio 2022 preview and other prerequisites for developing.net core 6 applications and other projects in our environment.

I tried to construct a sample .net core 6 app on my local machine and publish it to Azure under my resource group by creating an azure app service plan, however I didn't install any dependencies. It was successfully uploaded to Azure.

Here are steps for reference: enter image description here

enter image description here

enter image description here

After successfully published to Azure output:

enter image description here

For more information please refer the Visual studio 2022 preview release notes & MS DOC for Deploy an ASP.NET web app to Azure