aws / aws/aws-toolkit-visual-studio
Can I build a ReadyToTun instance targeting dotnet3.1 on Windows
- Dominant language
- No language data
- Stars
- 135
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
I am deploying my dotnet application on lambda but I am having issues with cold starts. I've determined this is partly caused by JIT compilation time.
Lambda has recently introduced the `dotnet3.1` runtime which supports ReadyToRun. This compiles the application ahead of time.
https://aws.amazon.com/blogs/compute/announcing-aws-lambda-supports-for-net-core-3-1/
I have added the relevant msbuild parameters to my `aws-lambda-tools-defaults.json` file as follows:
```
"msbuild-parameters": "/p:PublishReadyToRun=true --self-contained false"
```
On build I get the following error:
> error NETSDK1095: Optimizing assemblies for performance is not supported for the selected target platform or architecture. Please verify you are using a supported runtime identifier, or set the PublishReadyToRun property to false.
I have determined this is caused by me attempting to build a Linux instance on Windows as described in the ReadyToRun documentation:
https://docs.microsoft.com/en-us/dotnet/core/deploying/ready-to-run#cross-platformarchitecture-restrictions
What is the simplest solution to this problem?
AWS SAM CLI supports a `use-container` flag which resolves similar issues by performing the build on the target operating system within a Docker container. Is there similar functionality available in AWS Toolkit?
Contributor guide
Research direction
Start with the AWS Toolkit build path and the aws-lambda-tools-defaults.json msbuild-parameters example in the issue. Reproduce the NETSDK1095 failure for dotnet3.1 on Windows, then compare the Toolkit options with AWS SAM CLI's use-container behavior. Done means the supported solution is identified or containerized ReadyToRun builds are specified and verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, docker
- Domain
- cloud, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100