Nextended.Aspire 9.0.13

dotnet add package Nextended.Aspire --version 9.0.13
                    
NuGet\Install-Package Nextended.Aspire -Version 9.0.13
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nextended.Aspire" Version="9.0.13" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nextended.Aspire" Version="9.0.13" />
                    
Directory.Packages.props
<PackageReference Include="Nextended.Aspire" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nextended.Aspire --version 9.0.13
                    
#r "nuget: Nextended.Aspire, 9.0.13"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Nextended.Aspire&version=9.0.13
                    
Install Nextended.Aspire as a Cake Addin
#tool nuget:?package=Nextended.Aspire&version=9.0.13
                    
Install Nextended.Aspire as a Cake Tool

.NET Aspire Extensions

The .NET Aspire Extensions library provides a set of convenient extension methods that simplify the configuration of distributed applications built with the Aspire framework. These extensions enable conditional dependency setup, environment variable management, and Docker checks in a clear and expressive manner.

Key Features

Conditional Dependency Configuration

  • WaitForIf / WaitForCompletionIf
    Conditionally waits for a dependency resource to be available if it implements the required interface.

  • WithReferenceIf
    Automatically adds a reference to a dependency if it is provided.

Environment Variable Helpers

  • WithEnvironment
    Configures environment variables by generating keys from lambda expressions using the CallerArgumentExpression attribute.

  • WithEndpointAsEnvironmentIf
    Sets an environment variable based on an external endpoint if available.

Docker Management

  • EnsureDockerRunning / EnsureDockerRunningIf / EnsureDockerRunningIfLocalDebug
    Ensures that Docker is running before the application starts, which is especially useful during development and debugging.

Example Usage

Below is an exemplary snippet demonstrating how to use some of these extensions to configure resources in a distributed application:

using Aspire.Hosting.Postgres;
using Coworkee.AppHost;
using Coworkee.Application.Configurations;

var builder = DistributedApplication.CreateBuilder(args);

// Example: Configure a Postgres resource.
var db = builder.AddPostgres("pg")
    .PublishAsContainer()
    .AddDatabase(nameof(ServerConfiguration.ConnectionStrings.DefaultConnection), "ExampleDb");

// Optionally, wait for a dependent resource if it is provided.
db = db.WaitForIf(someDependencyResource);

// Example: Set an environment variable with automatic key generation.
db = db.WithEnvironment<SomeResourceType, SomeTargetType>(
    s => s.SomeProperty, "SomeValue");

// Build the application and ensure Docker is running in local debug mode.
builder.Build()
    .EnsureDockerRunningIfLocalDebug()
    .Run();

Contributing

Contributions are welcome! If you have suggestions or find any issues, please open an issue or submit a pull request.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
9.0.13 153 4/21/2025
9.0.12 157 4/1/2025
9.0.11 151 4/1/2025
9.0.10 147 3/31/2025
9.0.3 108 2/12/2025