Skip to content

When trying to install a tool where the required runtime isn't installed, a bad error message is generated #46566

Description

@dsplaisted

With the .NET 8.0 SDK (and no .NET 9 installed):

dotnet new tool-manifest --force
dotnet tool install powershell

Result:

Unhandled exception: Microsoft.DotNet.ToolPackage.ToolConfigurationException: Settings file 'DotnetToolSettings.xml' was not found in the package.
at Microsoft.DotNet.ToolPackage.ToolPackageInstance.DeserializeToolConfiguration(LockFileTargetLibrary library)
at Microsoft.DotNet.ToolPackage.ToolPackageInstance.GetToolConfiguration()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy1.CreateValue() at Microsoft.DotNet.ToolPackage.ToolPackageInstance.GetCommands() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue()
at Microsoft.DotNet.Tools.Tool.Install.ToolInstallLocalCommand.Install(FilePath manifestFile)
at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)

It looks like this is because the latest version of the Powershell package requires .NET 9 (ie it only has a tools/net9.0 folder). We should be displaying an error message that the .NET 9 runtime is required instead of the current message.

This may already be fixed in .NET 9, I know we were working on some improvements to the experience.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions