Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dotnet fails to install tools

I cannot install the AWS Lambda tools in dotnet:

$ dotnet tool install -g Amazon.Lambda.Tools
error NU1100: Unable to resolve 'amazon.lambda.tools (>= 0.0.0)' for '.NETCoreApp,Version=v3.1'.
error NU1100: Unable to resolve 'amazon.lambda.tools (>= 0.0.0)' for '.NETCoreApp,Version=v3.1/any'.
The tool package could not be restored.
Tool 'amazon.lambda.tools' failed to install. This failure may have been caused by:
You are attempting to install a preview release and did not use the --version option to specify the version.
A package by this name was found, but it was not a .NET Core tool.
The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
You mistyped the name of the tool.
For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool

Similar result when trying to install the Lambda templates:

$ dotnet new -i Amazon.Lambda.Templates
Determining projects to restore...
C:\Users\Me\.templateengine\dotnetcli\v3.1.404\scratch\restore.csproj : 
error NU1100: Unable to resolve 'Amazon.Lambda.Templates (>= 0.0.0)' for '.NETCoreApp,Version=v1.0'.

I'm using Windows 10, same results with both a bash shell and a DOS command line.

.NET Core v3.1 appears to be installed ok:

$ dotnet --version
3.1.404

I tried uninstalling .NET Core SDK v3.1 and repeating with .NET Core SDK v2.1, and also with .NET SDK 5.0, same results. I tried disabling anti-virus, no effect.

Same result when trying to install a specific version number:

$ dotnet tool install --global Amazon.Lambda.Tools --version 5.0.0
error NU1100: Unable to resolve 'amazon.lambda.tools (>= 5.0.0)' for '.NETCoreApp,Version=v3.1'.

I manually downloaded the package from https://www.nuget.org/packages/Amazon.Lambda.Tools/5.0.0. The downloaded package filename is amazon.lambda.tools.5.0.0.nupkg. I then tried to install this local copy of the package, but it failed (though I'm not confident that I'm using this command correctly):

$ dotnet tool install -g Amazon.Lambda.Tools --add-source ./amazon.lambda.tools.5.0.0.nupkg
C:\Program Files\dotnet\sdk\3.1.404\NuGet.targets(128,5): error : The local source 'C:\Users\Me\Desktop\amazon.lambda.tools.5.0.0.nupkg' doesn't exist. (C:\Users\Me\AppData\Local\Temp\g23ky0jg.io4\restore.csproj)
The tool package could not be restored.
like image 323
HenrySchwarz Avatar asked Jan 30 '26 05:01

HenrySchwarz


1 Answers

Your NuGet.config looks like it's on version 2. This is what mine looks like:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
</configuration>
like image 152
Philip Pittle Avatar answered Feb 01 '26 21:02

Philip Pittle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!