Support for .NET Core 2.1
Hi,
Just curious if .NET Core 2.1 support will become available soon after it has been released, or can we expect it taking a longer time, like what happened with .NET Core 2.0? Are there any significant changes that need to be made to Lambda?
On another note, are there any plans to support .NET Core 2.1 RC1? 🤔
Thanks!
Seems like .NET Core 2.1.2 is now out with some security update. Is it going to be difficult/time consuming process for Lambda to support the latest version of .NET Core?
@raRaRa We are working on the 2.1.2 but I'm not sure of the timing when it will be in Lambda.
I upgraded the AWS Toolkit to version 1.14.4.0, Microsoft.AspNetCore.App to 2.1.0 and Amazon.Lambda.Tools to 2.2.0
When I Publish to AWS Lambda the dialog shows the correct framework (2.1) and deploys smoothly.
However when I access the API, I get an error and the CloudWatch says:
It was not possible to find any compatible framework version
The specified framework 'Microsoft.AspNetCore.App', version '2.1.0' was not found.
- Check application dependencies and target a framework version installed at:
/
- Alternatively, install the framework version '2.1.0'.
Failed to execute the Lambda function. The dotnet CLI failed to start with the provided deployment package. Please check CloudWatch logs for this Lambda function to get detailed information about this failure.: LambdaException
Am I doing something wrong?
In your serverless.template file for the AWS::Serverless::Function resource did you update the Runtime property to dotnetcore2.1. Sorry we should have put that in the blog post.
@normj That was the missing piece. Thanks!
I've found that for Tiered Compilation to be enabled, it needs to be set as a AWS Function environment variable. E.g. in serverless.template:
"Environment": {
"Variables": {
"COMPlus_TieredCompilation" : 1
}
}
Seems to have a noticable performance improvement on cold start.
@ferugi Super interesting, thanks for sharing. Do you know if there are any known side effects of using tiered compilation, e.g. could it actually cause overall worse performance while the startup time becomes faster.
@ferugi Any chance you can quantify the performance improvement? I didn't really notice much in my testing but I might not have had enough of a real world scenario.
Sorry for the slow response. @normj I don't have a good real world example, but a quick test with Lambda and API Gateway gave these results (128mb memory). @raRaRa I don't know enought to give you a real answer. That said, in the test I ran it did look like there was a bit more variation in response time of subsequent calls when Tiered Compilation was enabled.
@normj Any update on support for .NET Core 2.1.2? Thanks!
No updates. We're still working on getting it out as soon as we can.
[SOLVED] By deleting and recreating the instance of my app in Beanstalk and then redeploying.
Apparently Dotnet Core 2.1 is supported native on beanstalk according to the link below. But I still get the "Process Failure" message as if it isn't.
https://aws.amazon.com/about-aws/whats-new/2018/06/aws-elastic-beanstalk-supports--net-core-2-1-on-windows-server-p/
https://blogs.msdn.microsoft.com/dotnet/2018/08/02/tiered-compilation-preview-in-net-core-2-1/
Once you have updated to 2.1.2 then 2.1.0 will no longer allow dynamic changes to cshtml files. I get this error https://github.com/dotnet/core/issues/1728
This has forced us to upgrade to 2.1.2 to get back productivity. Unfortunately we can no longer deploy to Lambda so we are currently stuck.
Also quite stuck without the latest patch. Will 2.1.1 / 2.1.2 be ready soon, or should we consider changing our architecture entirely, to self-built docker containers with Fargate/self-hosted Kubernetes?
We're working to get 2.1.2 released as soon as possible. You shouldn't need to change anything.
In the meantime 2.1.3 is out.
Just out of curiosity, what's involved in upgrading to latest .NET major or minor version? Feels like a continuous catch-up cycle.
There are a lot of steps behind the scenes to build, test, verify and deploy new runtimes into AWS Lambda.
You're totally right about the catch-up cycle thing. Improving that is one of our top priorities for AWS Lambda .NET Core support.
2.1.4 is out now.
We're working on that now instead. We'll keep you posted.