Skip to content

Unhandled exception: System.IO.IOException: Access to the path '...\build\tools\.store\.stage\ftb2snwd.f5x' is denied. #4315

@paulomorgado

Description

@paulomorgado

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

Cake runner

Cake Frosting

Cake version

4.0.0

Operating system

Windows

Operating system architecture

64-Bit

CI Server

No response

What are you seeing?

This happens when a Cake Frosting program has InstallTool with dotnet.

Visual Studio hold the ...\build\tools\.store\.stage hostage:

Installing tools...
Installing tool 'Microsoft.Sbom.DotNetTool'...
Configured Tools Folder: .../build/tools
Executing: "dotnet" tool list --tool-path ".../build/tools"
Package Id      Version      Commands
-------------------------------------
There are 0 dotnet tools installed
Checking for tool: microsoft.sbom.dotnettool
Running dotnet tool with operation Install: Microsoft.Sbom.DotNetTool...
Executing: "dotnet" tool install "Microsoft.Sbom.DotNetTool" --tool-path "C:/src/services-platform/connext/connector_demo_1/build/tools" --version 2.* --verbosity diagnostic
Unhandled exception: System.IO.IOException: Access to the path '...\build\tools\.store\.stage\by43pdyi.4ao' is denied.
   at System.IO.FileSystem.MoveDirectory(String sourceFullPath, String destFullPath, Boolean _)
   at System.IO.FileSystem.MoveDirectory(String sourceFullPath, String destFullPath)
   at Microsoft.DotNet.Cli.Utils.FileAccessRetrier.RetryOnMoveAccessFailure(Action action)
   at Microsoft.DotNet.Cli.ToolPackage.ToolPackageDownloader.<>c__DisplayClass8_0.<InstallPackage>b__0()
   at Microsoft.DotNet.Cli.TransactionalAction.Run[T](Func`1 action, Action commit, Action rollback)
   at Microsoft.DotNet.Tools.Tool.Install.ToolInstallGlobalOrToolPathCommand.<>c__DisplayClass20_0.<Execute>b__1()
   at Microsoft.DotNet.Tools.Tool.Install.ToolInstallGlobalOrToolPathCommand.RunWithHandlingInstallError(Action installAction)
   at Microsoft.DotNet.Tools.Tool.Install.ToolInstallGlobalOrToolPathCommand.Execute()
   at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)

This doesn't happen when using InstallTool with nuget.

What is expected?

This happens with this simple program:

public static class Program
{
    public static int Main(string[] args)
    {
        return new CakeHost()
            .InstallTool(new Uri("dotnet:?package=Microsoft.Sbom.DotNetTool&version=2.*"))
            .Run(args);
    }
}

Steps to Reproduce

This happens when a Cake Frosting program has InstallTool with dotnet.

Visual Studio hold the ...\build\tools\.store\.stage hostage.

This doesn't happen when using InstallTool with nuget.

Output log

Installing tools...
Installing tool 'Microsoft.Sbom.DotNetTool'...
Configured Tools Folder: .../build/tools
Executing: "dotnet" tool list --tool-path ".../build/tools"
Package Id      Version      Commands
-------------------------------------
There are 0 dotnet tools installed
Checking for tool: microsoft.sbom.dotnettool
Running dotnet tool with operation Install: Microsoft.Sbom.DotNetTool...
Executing: "dotnet" tool install "Microsoft.Sbom.DotNetTool" --tool-path "C:/src/services-platform/connext/connector_demo_1/build/tools" --version 2.* --verbosity diagnostic
Unhandled exception: System.IO.IOException: Access to the path '...\build\tools\.store\.stage\by43pdyi.4ao' is denied.
   at System.IO.FileSystem.MoveDirectory(String sourceFullPath, String destFullPath, Boolean _)
   at System.IO.FileSystem.MoveDirectory(String sourceFullPath, String destFullPath)
   at Microsoft.DotNet.Cli.Utils.FileAccessRetrier.RetryOnMoveAccessFailure(Action action)
   at Microsoft.DotNet.Cli.ToolPackage.ToolPackageDownloader.<>c__DisplayClass8_0.<InstallPackage>b__0()
   at Microsoft.DotNet.Cli.TransactionalAction.Run[T](Func`1 action, Action commit, Action rollback)
   at Microsoft.DotNet.Tools.Tool.Install.ToolInstallGlobalOrToolPathCommand.<>c__DisplayClass20_0.<Execute>b__1()
   at Microsoft.DotNet.Tools.Tool.Install.ToolInstallGlobalOrToolPathCommand.RunWithHandlingInstallError(Action installAction)
   at Microsoft.DotNet.Tools.Tool.Install.ToolInstallGlobalOrToolPathCommand.Execute()
   at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions