Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Hello, were you able to find a solution?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am trying to publish my ASP.NET Web API project, but the publish process fails with the following error:
2/26/2026 12:33:17 PM
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.\<---
The publish operation stops immediately and does not provide detailed information in the publish window. The only message displayed is:
Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed.
Check the Output window for more details.
In the console : VSMSDeploy: Publish failed to deploy.
: Output Property: _PublishResult=False
Done executing task "VSMSDeploy" -- FAILED.
Done building target "MSDeployPublish" in project "Orbis.Web.Api.csproj" -- FAILED.
Done building project "Orbis.Web.Api.csproj" -- FAILED.
I have checked:
However, I still cannot identify the exact cause of the build failure.
I'm on .net 9.
Has anyone experienced this issue before?
What are the possible reasons for this error during publishing, and how can I get more detailed diagnostics to fix it?
Thank you for your help.
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Hello, were you able to find a solution?
Thank you for your support.
Regarding the publish.binlog, I generated the file as instructed, but I could not find any errors (please see the attached screenshot). I also checked the tree structure in MSBuild Structured Log Viewer, but I may not be searching in the correct place.
For publishing, I am using Azure App Service, not IIS, so I did not change anything related to IIS configuration.
I have already tried the following steps multiple times:
Deleted and recreated the publish profile
Created a completely new Azure App Service
Deleted the bin, obj, and .vs folders
Verified that the App Service is running
Checked that the RuntimeIdentifier is compatible
Despite all these attempts, the publication still fails.
Thank you for reaching out to Microsoft Q&A.
This issue occurs because the Visual Studio Publish pipeline fails during the MSDeploy (Web Deploy) stage, even though the project may build successfully. When you publish an ASP.NET Web API project, Visual Studio runs additional MSBuild targets beyond a normal build, such as computing publish assets, transforming configuration files, and deploying via Web Deploy (MSDeploy). If any of these steps fail, Visual Studio often throws a generic exception (Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed) without surfacing the actual root cause in the Publish window. This is why you do not see meaningful errors in the Error List or standard Output window. In most cases, the real issue is related to Web Deploy connectivity, publish profile configuration, missing or corrupted Web Deploy components, or publish-time MSBuild tasks that do not run during a normal build, especially when using newer SDKs like .NET 9.
Refer below points to resolve this issue or as a workaround
1. Enable detailed diagnostics to identify the real error
The publish UI hides the underlying MSBuild or MSDeploy failure. Running publish from the command line with diagnostic logging exposes the exact failing task.
dotnet publish Orbis.Web.Api.csproj -c Release -v:diag -bl:publish.binlog
Open the generated publish.binlog using MSBuild Structured Log Viewer and look for the first actual error (for example, MSDeploy connection errors, missing targets, or asset computation failures).
2. Verify Web Deploy (MSDeploy) installation and services If the failure occurs in the MSDeployPublish target, the issue is often with Web Deploy itself.
net stop wmsvc
net start wmsvc
net stop msdepsvc
net start msdepsvc
If Web Deploy was installed before IIS Management Tools, reinstalling Web Deploy can resolve silent failures.
3. Validate publish profile and deployment method Incorrect or outdated publish profiles can cause publish-time failures.
4. Check Output window configuration in Visual Studio Some publish errors only appear in a specific output mode.
5. Clean cached build artifacts and Visual Studio state Corrupted intermediate files can cause publish failures.
bin
obj
.vs6. Review publish-time configuration and runtime settings Publish runs extra steps that a normal build does not.
RuntimeIdentifier, PlatformTarget, and publish profile settings are compatible (for example, avoid mismatches like win-x64 with x86).