feat(Templates): Update aws-csharp to .NET Core 3.1 (#7708)

This commit is contained in:
Joseph Woodward 2020-05-11 11:26:42 +01:00 committed by GitHub
parent 5b4fd0fd96
commit 46df82ea92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 22 deletions

View File

@ -64,7 +64,7 @@ services:
volumes:
- ./tmp/serverless-integration-test-aws-scala-sbt:/app
aws-csharp:
image: microsoft/dotnet:2.0-sdk
image: mcr.microsoft.com/dotnet/core/sdk:3.1
volumes:
- ./tmp/serverless-integration-test-aws-csharp:/app
aws-fsharp:

View File

@ -39,7 +39,7 @@ Using the `create` command we can specify one of the available [templates](https
The `--path` or shorthand `-p` is the location to be created with the template service files. Change directories into this new folder.
## 2. Build using .NET Core 2.X CLI tools and create zip package
## 2. Build using .NET Core 3.1 CLI tools and create zip package
```
# Linux or Mac OS

View File

@ -1,8 +1,6 @@
using Amazon.Lambda.Core;
using System;
[assembly:LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
[assembly:LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))]
namespace AwsDotnetCsharp
{
public class Handler
@ -29,11 +27,5 @@ namespace AwsDotnetCsharp
public string Key1 {get; set;}
public string Key2 {get; set;}
public string Key3 {get; set;}
public Request(string key1, string key2, string key3){
Key1 = key1;
Key2 = key2;
Key3 = key3;
}
}
}

View File

@ -1,19 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AssemblyName>CsharpHandlers</AssemblyName>
<PackageId>aws-csharp</PackageId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.Core" Version="1.0.0" />
<PackageReference Include="Amazon.Lambda.Serialization.Json" Version="1.3.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Amazon.Lambda.Tools" Version="2.2.0" />
<PackageReference Include="Amazon.Lambda.Core" Version="1.1.0" />
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.0.1" />
</ItemGroup>
</Project>

View File

@ -1,2 +1,3 @@
dotnet restore
dotnet lambda package --configuration release --framework netcoreapp2.1 --output-package bin/release/netcoreapp2.1/hello.zip
dotnet tool install -g Amazon.Lambda.Tools --framework netcoreapp3.1
dotnet lambda package --configuration Release --framework netcoreapp3.1 --output-package bin/Release/netcoreapp3.1/hello.zip

View File

@ -8,4 +8,5 @@ then
fi
dotnet restore
dotnet lambda package --configuration release --framework netcoreapp2.1 --output-package bin/release/netcoreapp2.1/hello.zip
dotnet tool install -g Amazon.Lambda.Tools --framework netcoreapp3.1
dotnet lambda package --configuration Release --framework netcoreapp3.1 --output-package bin/Release/netcoreapp3.1/hello.zip

View File

@ -22,7 +22,7 @@ service: aws-csharp # NOTE: update this with your service name
provider:
name: aws
runtime: dotnetcore2.1
runtime: dotnetcore3.1
# you can overwrite defaults here
# stage: dev
@ -57,7 +57,7 @@ functions:
# you can add packaging information here
package:
artifact: bin/release/netcoreapp2.1/hello.zip
artifact: bin/Release/netcoreapp3.1/hello.zip
# exclude:
# - exclude-me.js
# - exclude-me-dir/**