question

HenrySchwarz-7651 avatar image
0 Votes"
HenrySchwarz-7651 asked Amiko-8691 published

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.
dotnet-csharpdotnet-cli
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

If your .NET Core version is 3.x, can you try,

 dotnet tool install --global Amazon.Lambda.Tools --version 3.1.0

If you are on latest .NET,

  dotnet tool install --global Amazon.Lambda.Tools
0 Votes 0 ·

Same failed result:

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



0 Votes 0 ·

Hi Henry, can you install other .NET tools like dotnetsay using the command: dotnet tool install -g dotnetsay? It can help us to check if this issue relates to this Amazon.Lambda.Tools or your local dotnet tool, I tried your shared commands and they are works fine. If all .NET tools cannot be installed, please try to repair .NET 5.0 or uninstall and reinstall it with the latest version from here: https://dotnet.microsoft.com/download.

0 Votes 0 ·
vb2ae avatar image
0 Votes"
vb2ae answered Melanke-9649 commented

I have .net 5 installed and the aws tools installed for me.

You can install .net 5 from here


52925-aws-install.png



aws-install.png (146.9 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I've tried with .NET Core 3.1, .NET Core 2.1, and .NET 5.0, the result is always the same failure.

0 Votes 0 ·

I had the exact same problem, it was caused by not having NuGet installed on the computer. People usually don't have this problem because they install Visual Studio which comes with NuGet.

0 Votes 0 ·
GaneshMuni-3376 avatar image
0 Votes"
GaneshMuni-3376 answered

Use dotnet core 3.1 and runtime 3.1

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RodrigoGroener-5764 avatar image
11 Votes"
RodrigoGroener-5764 answered Amiko-8691 published

dotnet nuget list source returned an empty list.
I guess you only run into this problem when you install dotnet without having visual studio installed on your machine that pre populates the official nuget site as source.

running dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org fixed the issue for me.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

that was the correct suggestion. Thanks Rodrigo!

1 Vote 1 ·

Thank you for this, you have saved me a great deal of time and troubleshooting, this solved my issue 100%.
I do not have Visual Studio on my workstation either...and this fixed it. Thank you very much for sharing this.

Kind Regards

1 Vote 1 ·