wegry
wegry

Reputation: 8147

Could not load file or assembly 'AWSSDK.Core On .net core in AWS Lambda

Using this template, I've been trying to get a Lambda function running. When it goes to execute a module containing

open Amazon
open Amazon.S3

it blows up with a

"errorType": "FileNotFoundException",

"errorMessage": "Could not load file or assembly 'AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604'. The system cannot find the file specified.",`

I've tried a nuget install of AWSSDK.Core to no avail.

Errors in /Users/sanitized/aws_lambda/project.json
    Package AWSSDK.Core 3.1.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package AWSSDK.Core 3.1.0 supports:
      - monoandroid (MonoAndroid,Version=v0.0)
      - net35 (.NETFramework,Version=v3.5)
      - net45 (.NETFramework,Version=v4.5)
      - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
      - win8 (Windows,Version=v8.0)
      - wp8 (WindowsPhone,Version=v8.0)
      - wpa81 (WindowsPhoneApp,Version=v8.1)
      - xamarinios10 (Xamarin.iOS,Version=v1.0)
      - xamarinmac20 (Xamarin.Mac,Version=v2.0)
    One or more packages are incompatible with .NETCoreApp,Version=v1.0.

Here's the dependencies section of my project:

  "dependencies": {
    "Microsoft.FSharp.Core.netcore": "1.0.0-alpha-*",
    "Amazon.Core": "0.6.0",
    "Amazon.Lambda.Core": "1.0.0*",
    "Amazon.Lambda.Serialization.Json": "1.0.0",
    "Amazon.Lambda.Tools": {
      "type": "build",
      "version": "1.0.0-preview1"
    }
  },

The Lambda libraries seem to load correctly, but attempting to use an S3 client breaks. What're the .net-core blessed equivalents of AWSSDK.Core and AWSSDK.S3?

Upvotes: 3

Views: 11492

Answers (1)

sous2817
sous2817

Reputation: 3960

As the error states:

Package AWSSDK.Core 3.1.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0)

According to this link:

To use the the AWS sdk in ASP.NET Core based applications you 
need to use the 3.2.X versions of the NuGet packages. 
Note, they are currently marked as beta.

Upvotes: 2

Related Questions