При выполнении dotnet lambda deploy-function
компилятор жалуется с 'APIGatewayProxyResponse' does not contain a definition for 'IsBase64Encoded'
.
Часть кода:
public class Function
{
public APIGatewayProxyResponse FunctionHandler(APIGatewayProxyRequest Request, ILambdaContext context)
{
return new APIGatewayProxyResponse
{
Body = EncodeTo64("foo"),
IsBase64Encoded = true,
StatusCode = 200
};
}
}
.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AWSProjectType>Lambda</AWSProjectType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.Core" Version="1.0.0" />
<PackageReference Include="Amazon.Lambda.Serialization.Json" Version="1.3.0" />
<PackageReference Include="Amazon.Lambda.APIGatewayEvents" Version="1.0.0" />
<PackageReference Include="MongoDB.Bson" Version="2.0.0" />
<PackageReference Include="MongoDB.Driver" Version="2.0.0" />
<PackageReference Include="iTextSharp" Version="4.1.2" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Amazon.Lambda.Tools" Version="2.2.0" />
</ItemGroup>
</Project>