net8.0net9.0
Azure Dapr support for .NET Aspire.
Published
Mar 14, 2025
1y ago
Total Downloads
95.9K
95,924
Install
dotnet add package CommunityToolkit.Aspire.Hosting.Azure.Dapr --version 9.2.2-beta.236
| Product | Versions |
|---|---|
| .NET |
README
CommunityToolkit.Aspire.Hosting.Azure.Dapr library
Provides extension methods and resource definitions for a .NET Aspire AppHost to configure Dapr resources.
Getting started
Install the package
In your AppHost project, install the .NET Aspire Dapr Hosting library with NuGet:
dotnet add package CommunityToolkit.Aspire.Hosting.Azure.Dapr
Usage example
Then, in the Program.cs file of AppHost, add Dapr resources and consume the connection using the following methods:
var builder = DistributedApplication.CreateBuilder(args);
var stateStore = builder.AddDaprStateStore("statestore");
var pubSub = builder.AddDaprPubSub("pubsub");
builder.AddProject<Projects.MyApp>("myapp")
.WithDaprSidecar()
.WithReference(stateStore)
.WithReference(pubSub);
builder.Build().Run();
Additional documentation
Feedback & contributing
Changes from Previous Version
No structural changes between v9.2.2-beta.230 and v9.2.2-beta.236.
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.