Microsoft officially released dot net 6.0 on Nov 8, 2021 and AWS started supporting dotnet6.0 runtime few months after official release.
You maybe wandering how to build Dotnet 6 projects in AWS CodeBuild; because as of now, No CodeBuild Docker image comes with dotnet 6.0 pre-installed. we have to install Dotnet 6.0 in the build image before building our Dotnet6.0 project.
For more blogs, Visit https://infinity-creator.blogspot.com/
Below are the commands which you need to add in your buildspec YAML file
phases:
install:
commands:
- /usr/local/bin/dotnet-install.sh --channel LTS
Above commands installs/upgrades the Dotnet version to 6.0
For the CodeBuild environment, use the aws/codebuild/standard:5.0 or aws/codebuild/standard:6.0
Code build template configuration to be used (You can try with different Environment Type)
Type: AWS::CodeBuild::Project
Properties:
Artifacts:
<ArtifactsComesHere>
Environment:
Type: LINUX_CONTAINER
Image: aws/codebuild/standard:5.0
Happy Coding!
Useful links: