16

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 ==========
Bob Koury
  • 273
  • 3
  • 10

5 Answers5

16

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.

Joe
  • 161
  • 4
  • 1
    Same solution for me, I deleted the License folder on the server using FileZilla. – Manuel Fabbri Dec 26 '21 at 11:33
  • 3
    Also worked for me, fixed using FileZilla. However, it's not VS 2022, it's targeting .NET 6. With VS 2022 everything worked fine when I targeted .NET 5, but when I changed the target to .NET 6, it broke with this Bootstrap LICENSE error. – Tony Isaac Dec 28 '21 at 04:44
  • 2
    @TonyIsaac: I think you're correct. .NET 6 uses Bootstrap 5, whereas .NET 5 used Bootstrap 4. Consequently there's a change in the location/content of the Bootstrap files that get included by the Identity package. – Gary McGill Feb 28 '22 at 17:00
  • 3
    Thanks, @TonyIsaac @GaryMcGill The problem was that in .Net 5 there was a folder named `Identity/Bootstrap/LICENSE` and inside it a `LICENSE` file, and after migration to .Net 6 the bootstrap folder structure changed. The `LICENSE` folder was removed and the `LICENSE` file was moved to the path `Identity/Bootstrap/`. The error was that the deploy service was trying to create the file `LICENSE` at the exact location beside the old `LICENSE` folder! – Ahmed Suror Dec 31 '22 at 19:46
13

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.
Bob.at.Indigo.Health
  • 11,023
  • 13
  • 64
  • 111
  • 2
    Helpful commands to resolve the issue. I only needed to remove the problematic LINCESE path (folder and file). Navigated to D:\home\site\wwwroot\wwwroot\Identity\lib\bootstrap and executed rmdir /s /q LICENSE – Giancarlo Sierra Mar 04 '22 at 00:52
  • 7
    We had the exact same access denied error for the LICENSE file. It turns out that upgrading to .NET 6 changes the location of the file, and the deployment fails. Using the Console in Azure App Service i navigated to `wwwroot\Identity\lib\bootstrap` and deleted the folder LICENSE (containing the file LICENSE). The next deployment then succeeded. – Frode Evensen Mar 04 '22 at 20:05
  • 1
    Frode Evansen's solution worked for me as well. – Doug Wilson Apr 16 '22 at 16:30
  • Instead of rmdir /s /q Identity I run: "rm -r Identity" It worked! – MarchalPT May 23 '22 at 14:51
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

Ramil Aliyev 007
  • 4,437
  • 2
  • 31
  • 47
Gir32
  • 51
  • 4
  • I thought issue was fixed. I'd configured "delete old files", publish worked (at which point MS support exited), thought I was OK, then realized later it was running old cold, not code I was trying to upload. I had to scour all publishing parameters. One of the ones that surprised me, buried in the csproj file XML had "publish" set to false; I had to change it to true. Then I got hit by access to my key vault file. I hope I'm past all that. – Bob Koury Jan 18 '22 at 17:32
3

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

2

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

Bob Koury
  • 273
  • 3
  • 10
  • not in azure. running on windows server. renamed the identity folder. re-released. new identity folder created ok. – Kirsten Apr 13 '23 at 21:31