Dotnet fails to install tools

Henry Schwarz 1 Reputation point
2021-01-03T20:10:59.32+00:00

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.
.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
322 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,245 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Rodrigo Groener 81 Reputation points
    2021-09-01T11:48:05.073+00:00

    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.

    16 people found this answer helpful.

  2. Ken Tucker 5,846 Reputation points
    2021-01-03T20:35:42.237+00:00

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

    You can install .net 5 from here

    52925-aws-install.png


  3. Ganesh Muni 1 Reputation point
    2021-08-10T11:14:13.57+00:00

    Use dotnet core 3.1 and runtime 3.1

    0 comments No comments