Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DirectoryNotFoundException using dotnet tool install -g CS-Script #369

Open
SchreinerK opened this issue May 1, 2024 · 3 comments
Open

Comments

@SchreinerK
Copy link

SchreinerK commented May 1, 2024

dotnet tool install -g CS-Script

Die Überprüfung der NuGet-Paketsignatur wird übersprungen.
Unhandled exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\Kay.dotnet\tools\.store\cs-script\4.8.14\cs-script\4.8.14\tools'.
at System.IO.Enumeration.FileSystemEnumerator1.CreateDirectoryHandle(String path, Boolean ignoreNotFound) at System.IO.Enumeration.FileSystemEnumerator1.Init()
at System.IO.Enumeration.FileSystemEnumerable1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized) at System.IO.Enumeration.FileSystemEnumerableFactory.UserDirectories(String directory, String expression, EnumerationOptions options) at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options) at System.IO.Directory.GetDirectories(String path, String searchPattern, EnumerationOptions enumerationOptions) at Microsoft.DotNet.ToolPackage.ToolPackageInstance..ctor(PackageId id, NuGetVersion version, DirectoryPath packageDirectory, DirectoryPath assetsJsonParentDirectory) at Microsoft.DotNet.Cli.ToolPackage.ToolPackageDownloader.<>c__DisplayClass8_0.<InstallPackage>b__0() at Microsoft.DotNet.Cli.TransactionalAction.Run[T](Func1 action, Action commit, Action rollback)
at Microsoft.DotNet.Tools.Tool.Install.ToolInstallGlobalOrToolPathCommand.<>c__DisplayClass18_0.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)

I dont know if this is related to the cs-script package or something wrong with dotnet tool installer.
C:\Users\Kay\.dotnet\tools.store exists and is active used for the other tools.

image

@oleg-shilo
Copy link
Owner

Hm... interesting.

It is a .NET error. The call stack there is all .NET API.

Though, on my system, it throws the same error. This discussion suggests that this type of error is raised when the package spec does not indicate the correct package type: dotnet/sdk#37010

Though cs-script package does have the correct type:
image

Unless they have changed the package type value again. Will need to dig into it.

@oleg-shilo
Copy link
Owner

WOW, not sure what is going on in the NuGet land.

Installing the the first, latest and some intermediate versions works just fine:

image

Note the last install on the screenshot, dotnet tool install --global cs-script.cli, it also install fine.
But just a minute ago it was failing with the same error as yours

@oleg-shilo
Copy link
Owner

oleg-shilo commented May 1, 2024

OMG
I see it LOL

You and I have made the same mistake. We were trying to install not a tool but a package (a class library)

.NET Tool: cs-script.cli
.NET package: cs-script

Well, that is a complete solution to the problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants