Package Amazon.Lambda.Tools 3.0.1 is not compatibl

2020-04-16 06:30发布

问题:

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??

回答1:

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


回答2:

While the answer above will install the tools locally, you may also need to make sure your csproj includes the AWSProject type. See my answer to this post https://stackoverflow.com/a/55712772/407188.



回答3:

in my case by installing Version 3.3.1 AWS SDK work for me
Install-Package AWSSDK.Extensions.NETCore.Setup -Version 3.3.1 or look the appropriate version on this link https://www.nuget.org/packages/AWSSDK.Extensions.NETCore.Setup/3.3.1