GenerateAspNetCoreClient icon indicating copy to clipboard operation
GenerateAspNetCoreClient copied to clipboard

Install fails on .NET 9

Open MeikelLP opened this issue 1 year ago • 1 comments

The command dotnet tool restore fails in our pipeline. dotnet-tools.json:

{
  "version": 1,
  "isRoot": true,
  "tools": {
    "generateaspnetcoreclient.refit": {
      "version": "3.0.0",
      "commands": [
        "dotnet-generate-client"
      ],
      "rollForward": false
    }
  }
}
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.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at Microsoft.DotNet.ToolPackage.ToolPackageInstance.GetCommands()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at Microsoft.DotNet.Tools.Tool.Restore.ToolRestoreCommand.InstallPackages(ToolManifestPackage package, Nullable`1 configFile)
   at System.Linq.Enumerable.SelectArrayIterator`2.Fill(ReadOnlySpan`1 source, Span`1 destination, Func`2 func)
   at System.Linq.Enumerable.SelectArrayIterator`2.ToArray()
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Microsoft.DotNet.Tools.Tool.Restore.ToolRestoreCommand.Execute()
   at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)

I found a similar issue: https://github.com/chucknorris/roundhouse/issues/421

Thus I think this is the package's fault and not something I can fix myself. From what I can see you just need to add an "empty" DotnetToolSettings.xml

MeikelLP avatar Jan 02 '25 07:01 MeikelLP

Additional note:

This issue happened when installing the tool with net8 SDK which is not supported I know but the message is still confusing

MeikelLP avatar Jan 02 '25 08:01 MeikelLP