Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Package Amazon.Lambda.Tools 3.0.1 is not compatible with netcoreapp2.1 (.NETCoreApp,Version=v2.1).

I have installed dotnet tool.

install --global Amazon.Lambda.Tools --version 3.0.1 and trying to use in the .net core project 2.1. I am getting this error on setting the project file.

 <ItemGroup>
    <DotNetCliToolReference Include="Amazon.Lambda.Tools" Version="3.0.1" />
 </ItemGroup>  

but I am getting this error.

Package Amazon.Lambda.Tools 3.0.1 is not compatible with netcoreapp2.1 (.NETCoreApp,Version=v2.1). Package Amazon.Lambda.Tools 3.0.1 supports: netcoreapp2.1 (.NETCoreApp,Version=v2.1)

Help??

like image 745
Tamoj Avatar asked Sep 20 '18 07:09

Tamoj


2 Answers

The the info on the usage here: https://github.com/aws/aws-extensions-for-dotnet-cli

Basically you will need to remove this from the project file:

<-- This line needs to be removed -->
<DotNetCliToolReference Include="Amazon.Lambda.Tools" Version="X.X.X" />

and the tools will need to be installed the following way moving forward:

dotnet tool install -g Amazon.Lambda.Tools
like image 117
One of many Avatar answered Oct 13 '22 14:10

One of many


In late 2019, the tool got moved as a global one, instead of being installed locally within the project, it is installed at a machine level. Go to package manager console in VS, give the command as below:-

dotnet tool install -g Amazon.Lambda.Tools

If its an older project being migrated to newer version, in the project file, the DotNetCliToolReference line needs to be removed.

Now the project file has an entry which marks the project as a Lambda function as follows, if not present then this needs to be added manually in the main property group.

 <AWSProjectType>Lambda</AWSProjectType>

Ref: https://github.com/aws/aws-extensions-for-dotnet-cli

like image 30
NitinSingh Avatar answered Oct 13 '22 14:10

NitinSingh