Skip to content

Dotnet add package: don't fail when temp files are exhausted. #8559

@szahn

Description

@szahn

When adding a nuget package to a .net core app 1.1, get the following result:

A more useful error which doesn't cause the application to fail would be helpful.

PS C:\docker\benchmarks\src> dotnet add package System.Runtime.Serialization.Primitives -v 4.0.10

Unhandled Exception: System.IO.IOException: The file exists
   at System.IO.Path.GetTempFileName()
   at Microsoft.DotNet.Tools.Add.PackageReference.AddPackageReferenceCommand.Run(String fileOrDirectory)
   at Microsoft.DotNet.Cli.DotNetTopLevelCommandBase.<>c__DisplayClass10_1.<RunCommand>b__0()
   at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args)
   at Microsoft.DotNet.Cli.DotNetTopLevelCommandBase.RunCommand(String[] args)
   at Microsoft.DotNet.Tools.Add.AddCommand.Run(String[] args)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
   at Microsoft.DotNet.Cli.Program.Main(String[] args)
PS C:\docker\benchmarks\src>
PS C:\Docker\Benchmarks\src> dotnet add package "System.Runtime.Serialization.Primitives" -version "4.1.0-beta-23516"
Please specify one package reference to add.

dotnet add error

Environment data

dotnet --info output:
.NET Command Line Tools (1.0.4)

Product Information:
Version: 1.0.4
Commit SHA-1 hash: af1e668

Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions