Skip to content

Latest commit

 

History

History

dotnet9

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

.NET 9 support on AWS

This guide describes .NET 9 support provided by AWS services and tools. The guide will be updated as new support is added.

Related Content:

Introduction

.NET 9 is the latest version of cross-platform .NET, released in November 2024. .NET 9 includes extensive performance enhancements, .NET Aspire for cloud-native development, and improvements to ASP.NET, Blazor, and .NET MAUI. The instructions that follow explain how to use .NET 9 on AWS.

If you’re running an older version of .NET, be aware that both .NET 6 and .NET 7 have reached end of support. Per Microsoft's .NET Support Policy, .NET 9 (a Standard-Term Support release) will be supported through May 12, 2026, and .NET 8 (a Long-Term Support release) through November 10, 2026.

Compute Services

You can run .NET 9 today on Amazon Elastic Compute Cloud (Amazon EC2) and, using containers, Amazon Elastic Kubernetes Service (Amazon EKS), Amazon Elastic Container Service (Amazon ECS), and AWS Lambda.

Amazon EC2

Amazon EC2 offers broad and deep compute functionality, with granular control for managing your infrastructure with a choice of processors, storage, and networking. Customers can install .NET 9 on over 400 instance types.

To install .NET 9 on an EC2 instance, specify User Data commands when launching the instance.

For instructions and scripts on installing .NET on Linux, refer to .NET 9 installation instructions for Linux and Install .NET on Linux by using an install script or by extracting binaries.

You can use automation facilities in AWS Systems Manager to automatically install .NET runtimes using automation documents, and use the EC2 Image Builder service to pre-create EC2 Images with the .NET Runtime pre-installed.

AWS Elastic Beanstalk

Elastic Beanstalk is a managed service that allows you to quickly deploy and manage applications in the AWS Cloud without having to learn about the infrastructure that runs those applications. Your EC2 assets are fully visible in your AWS account and you have full access to them.

Elastic Beanstalk supports .NET 9 on Amazon Linux 2023. See AWS Elastic Beanstalk now supports .NET 9 on Amazon Linux 2023 for details.

AWS Lambda

AWS Lambda currently supports the .NET 8 runtime.

You can run .NET 9 applications on AWS Lambda in several ways. You can create your own custom runtime, deploy a container image, or publish native code to Lambda using NativeAOT compilation.

The .NET Lambda Annotations Framework simplifies the programming model and lets you write .NET Lambda functions more naturally in C#. When using custom runtimes or native ahead of time (Native AOT) compilation, the framework removes the need to manually bootstrap the Lambda runtime and can auto-generate the Main method. Refer to .NET Lambda Annotations Design - Auto Generate Main.

Containers

You can deploy .NET applications running on either Windows or Linux containers to Amazon ECS or Amazon EKS (Amazon EKS). AWS Fargate is a service that you can use to run and manage the lifecycle of ECS and EKS containers without the need to manage the container infrastructure yourself.

AWS App Runner is a fully managed service that makes it easy to quickly deploy containerized web applications and APIs, scaling up or down automatically to meet application traffic needs. To use with .NET 9 applications, upload a container image with the .NET 9 application to Amazon Elastic Container Registry (Amazon ECR) and use the source image support to configure AWS App Runner to start, run, scale, and load balance the application.

You can deploy a .NET 9 application to Elastic Beanstalk in a container. For more information, refer to Deploying Elastic Beanstalk applications from Docker containers.

Security and Diagnostics

AWS X-Ray

AWS X-Ray helps developers analyze and debug distributed applications, such as those built using a microservices architecture. .NET 9 applications can integrate AWS X-Ray with AWS X-Ray SDK for .NET and the AWS Distro for OpenTelemetry .NET.

Tools, Libraries, and SDK

If you’ve been using an older version of .NET on AWS, be sure to update the AWS tools installed on your developer machine.

AWS SDK for .NET

The AWS SDK for .NET allows .NET developers to integrate AWS services into their application code in a familiar and consistent manner. We recommend using the latest version of the SDK, version 4. The SDK is compatible with Native AOT since version 3.7.300. The SDK is available from NuGet. Learn how to get started with the AWS SDK for .NET in the Developer Guide.

AWS Code Build

AWS Code Build is a fully managed service that helps developers automatically build applications from source code. The CodeBuild service allows the user to customize the build environment, to suit the needs of the application being built. This includes the ability to install additional .NET runtimes. You can add support for building .NET 9 applications by adding the following snippet to your applications buildspec.yml file. Source: Install .NET on Linux by using an install script or by extracting binaries.

  install:
    commands:
      - curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 9.0 

This will automatically download and install the .NET 9 SDK as part of the Install phase of CodeBuild.

AWS Deploy Tool for .NET

The AWS Deploy Tool for .NET command line interface (CLI) is an interactive assistant that provides compute recommendations for .NET applications and deploys them to AWS in a few easy steps. The Deploy Tool supports .NET 9 applications by creating container images for container based services like Amazon ECS and AWS AppRunner or using .NET self-contained publishing for Elastic Beanstalk.

AWS Toolkit for Visual Studio

The AWS Toolkit for Visual Studio is an extension for Microsoft Visual Studio on Windows that makes it easier for developers to develop, debug, and deploy .NET applications using Amazon Web Services. Visual Studio 2022 supports .NET 9 development..

The Toolkit’s Publish to AWS feature integrates with the AWS Deploy Tool for .NET, and can deploy .NET 9 projects to various AWS services from Visual Studio as of version 1.60.0. You can deploy ASP.NET Core projects to Amazon ECS, AWS App Runner, Elastic Beanstalk Windows, Elastic Beanstalk Linux, or the Amazon Elastic Container Registry (Amazon ECR).

You can download the AWS Toolkit for Visual Studio 2022 from the Visual Studio Marketplace. If you're already using the AWS Toolkit for Visual Studio, be sure to upgrade to the latest version by navigating to Manage Extensions > Updates in Visual Studio.

.NET Modernization Tools

AWS provides assistive tools that help architects, developers, and IT professionals modernize .NET workloads.

The following AWS modernization tools support .NET 9:

AWS App2Container (A2C) is a command line tool that containerizes your applications. It automatically generates a container image configured with the correct dependencies, network configurations, and deployment instructions for Amazon ECS or Amazon EKS. A2C can detect a .NET 8 runtime version and containerize the application using the corresponding runtime base images.

The following AWS modernization tools support .NET 8:

Amazon Q Developer .NET transformation Amazon Q Developer now offers (in preview) new capabilities for porting .NET Framework applications to cross-platform .NET; using a web experience for large-scale porting, or a Visual Studio IDE experience. Accelerate .NET application porting from Windows to Linux up to 4 times faster. Streamline transformation tasks and slash operational costs by up to 40%.

AWS Microservice Extractor for .NET is an assistive tool that serves as an advisor to assess and visualize monolithic code, and recommend microservice candidates using artificial intelligence and heuristics. It also serves as a robotic builder to simplify microservices extraction. Microservice Extractor supports analyzing .NET 8 applications for visualization, grouping, and extraction. With its integrated strangler-fig porting capability, you can also use Microservice Extractor to break down a large .NET Framework-based application with hundreds of projects and thousands of classes into manageable groups and port those directly to .NET 8. Offload tedious .NET porting tasks, such as code analysis, dependency mapping, and refactoring, and reduce Windows licensing costs.

Migration Hub Strategy Recommendations (MHSR) helps you plan migration and modernization initiatives by offering strategy recommendations for viable transformation paths for your applications. MHSR can detect .NET 8 applications and provide recommendations for them.

For more information on .NET modernization use cases and tools, see Modernize .NET Workloads on AWS at the .NET on AWS developer center.

Conclusion

You can run .NET 9 workloads on AWS today across multiple AWS compute services. The SDK for .NET and multiple developer tools also support .NET 9. If you have existing AWS workloads on .NET 6 or .NET 7, be proactive in upgrading to .NET 8 or later as they are out of support. You can keep up to date on .NET on AWS developments by visiting the AWS .NET development center.

X