I recently discovered that if I add a reference to a project targeting .NET Standard 1.4 to my serverless project, I get the following error on dotnet lambda deploy-serverless
:
Error: Project is referencing NETStandard.Library version 1.6.1. Max version supported by netcoreapp1.0 is 1.6.0.
Error: NETStandard.Library 1.6.1 is used for target framework netcoreapp1.1.
Error: Check the following dependencies for versions compatible with netcoreapp1.0:
Error: amazon.lambda.apigatewayevents : 1.1.0
Error: amazon.lambda.serialization.json : 1.1.0
Error: testclasslibrary : 1.0.0
To reproduce. From Visual Studio 2017 (latest updates installed):
Incidentally, this appears to happen regardless of which version of .NET Standard you target in the class library.
In your csproj file for the class library can add the following as a sibling to the TargetFramework to force the implicit reference of NETStandard.Library to be 1.6.0.
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
Closing as I believe my last comment should unblock you. If not feel free to reopen.
That did the trick. Thanks.
thanks @normj - that tag did the trick!
Most helpful comment
In your csproj file for the class library can add the following as a sibling to the TargetFramework to force the implicit reference of NETStandard.Library to be 1.6.0.