Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on deploy when referencing a .NET Standard library #157

Closed
bslatner opened this issue Sep 1, 2017 · 5 comments
Closed

Error on deploy when referencing a .NET Standard library #157

bslatner opened this issue Sep 1, 2017 · 5 comments
Labels
guidance Question that needs advice or information.

Comments

@bslatner
Copy link

bslatner commented Sep 1, 2017

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):

  • File -> New Project
  • Select AWS Serverless Application (.NET Core)
  • Pick anything for the blueprint. I chose the blog API
  • From project directory
    • dotnet restore
    • dotnet build
    • dotnet lambda deploy-serverless
  • Observe that deployment works
  • Right click on solution in VS. Add .NET standard class library
  • Change targeting of library to .NET Standard 1.4
  • In Solution Explorer, right click on Dependencies under serverless app
  • Add a project reference to the class library
  • File -> Save All
  • From project directory
    • dotnet restore
    • dotnet build
    • dotnet lambda deploy-serverless
  • Observe that deployment fails
@bslatner
Copy link
Author

bslatner commented Sep 1, 2017

Incidentally, this appears to happen regardless of which version of .NET Standard you target in the class library.

@normj
Copy link
Member

normj commented Sep 1, 2017

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>

@normj normj added the Question label Sep 1, 2017
@normj
Copy link
Member

normj commented Sep 6, 2017

Closing as I believe my last comment should unblock you. If not feel free to reopen.

@normj normj closed this as completed Sep 6, 2017
@bslatner
Copy link
Author

bslatner commented Sep 7, 2017

That did the trick. Thanks.

@mrwcjoughin
Copy link

thanks @normj - that tag did the trick!

@diehlaws diehlaws added guidance Question that needs advice or information. and removed Question labels Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

4 participants