.NET Aspire 9.0
developrec
We're a leading contributor to the technology & software engineering community & an award-winning recruitment business.
Welcome back to your .NET newsletter!
The latest version of .NET Aspire (version 9.0) brings crucial improvements in container management, application lifecycle, and integrations.
Let`s dive in for the details.
Persistent Containers
.NET Aspire 9.0 supports persistent containers, allowing services to run independently of the application host's lifecycle. This feature ensures continuity for resources that must remain available, such as message queues or background processes. Persistent containers require explicit removal, providing better control over resource allocation. The configuration is straightforward:
var queue = builder.AddRabbitMQ("rabbit")
.WithLifetime(ContainerLifetime.Persistent);
In the Aspire dashboard, persistent containers are marked with a pin icon, distinguishing them from regular containers.
Eventing Model Improvements
An updated eventing model introduces new lifecycle hooks, enabling greater customisation and control. Developers can tie actions to specific application stages, such as resource creation or readiness. Key events include:
This granular control simplifies debugging and allows for tailored responses during application deployment.
Unified Networking for Containers
All containers in .NET Aspire 9.0 are connected through a unified default-aspire-network, improving inter-container communication.
This approach eliminates manual configuration steps for internal networking and simplifies migrations from systems like Docker Compose. Developers can directly reference container names for communication, streamlining multi-container setups.
New Integrations
The version expands integration support to include:
Redis Insights: Pre-configured dashboards for managing Redis resources, enhancing observability and diagnostics.
builder.AddRedis("redis")
.WithRedisInsight();
OpenAI Integration (Preview): Early support for the OpenAI .NET library, enabling integration with OpenAI APIs for natural language processing and other tasks.
领英推荐
These integrations highlight a focus on improving developer efficiency with pre-configured setups.
Migration and Upgrade Support
To facilitate the transition to .NET Aspire 9.0, Microsoft provides a dedicated Upgrade Assistant. Available via the .NET CLI or Visual Studio, this tool updates project references to ensure compatibility. For instance, the project file must target .NET 9.0:
<TargetFramework>net9.0</TargetFramework>
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.0.0" />
Developers should also review deprecated APIs and update custom configurations to leverage new features.
?? Hot .NET Jobs by develop ??
?? Our Social Stories ??
Our Managing Director , Joey Tait is working out of our Miami office this week.
We invited Trevor Pinder to our London HQ on Monday!
Life at develop: Our Growth Marketing Executive, Berk Ebcim got very protective of his water bottle, giving total Ross-from-Friends vibes—so, naturally, our Marketing Manager Sanj . had to film it!????
Are you following us?