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.



