'Visual Studio publish error code 0x80070005 -- Bootstrap license

Out of nowhere, after multiple successful Publishes, Visual Studio 2022 gives me an error when I try to publish to Azure. It's looking on my D: disk for a Bootstrap license. There is no D: disk.

I hit this a couple weeks, not with Publish but just building. I solved it eventually by deleting my bin folder. That's not working today.

Looking around, others have hit something similar, but did not seem to be my situation.

2021-12-01: no clues out there as to how to solve?

Here is log output:

Unable to perform the operation ("Create File") for the specified directory ("D:\home\site\wwwroot\wwwroot\Identity\lib\bootstrap\LICENSE"). This can occur if the server administrator has not authorized this operation for the user credentials you are using. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_INSUFFICIENT_ACCESS_TO_SITE_FOLDER. Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_INSUFFICIENT_ACCESS_TO_SITE_FOLDER. The error code was 0x80070005. Access to the path 'D:\home\site\wwwroot\wwwroot\Identity\lib\bootstrap\LICENSE' is denied. at Microsoft.Web.Deployment.NativeMethods.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath) at Microsoft.Web.Deployment.FileStreamEx.CreateInstance(String path, FileMode fileMode, FileAccess fileAccess, FileShare fileShare, Nullable`1 fileLength) at Microsoft.Web.Deployment.FilePathProviderBase.Add(DeploymentObject source, Boolean whatIf) Publish failed to deploy.

2>Build failed. Check the Output window for more details.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========


Solution 1:[1]

I'm having the same exact issue, looks like the issue is caused by VS 2022. I think it is taking a file that has no extension named License and mistaking it for a folder. I was able to fix the issue by deleting the License file and the folder that was created on my web server by VS 2022 on deploy.

Solution 2:[2]

I fixed it by doing the following:

  1. Open the Azure Portal
  2. Open the App Service page
  3. Open the Console blade
  4. In the console, navigate to D:\home\site\wwwroot\wwwroot
  5. Remove the Identity folder with rmdir /s /q Identity.

Solution 3:[3]

Got it fixed thanks to MS support. Somehow server folder wwwroot structure had been corrupted.

Solution 4:[4]

I was having similar issues regarding that file when deploying to azure app services.

I was able to fix the issue by ensuring that "Remove additional files at destination" was enabled.

Azure Portal:

Azure Portal

Solution 5:[5]

We're publishing to a folder and what fixed it for us was setting "Delete existing files" to true in the Publish Dialog.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Joe
Solution 2 Bob.at.Indigo.Health
Solution 3 Bob Koury
Solution 4 Ramil Aliyev
Solution 5 Squirrel in training