Skip to main content
net8.0

Dapr support for .NET Aspire.

Published
Jun 28, 2024
2y ago
Total Downloads
233.7K
233,742

Deprecated Package Version

Reason: Other

We will no longer be publishing new versions of this package. We recommend using the CommunityToolkit.Aspire.Hosting.Dapr package going forward.

Install

dotnet add package Aspire.Hosting.Dapr --version 8.0.2
ProductVersions
.NET
net8.0

README

Aspire.Hosting.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 Aspire.Hosting.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

https://dapr.io/

Feedback & contributing

https://github.com/dotnet/aspire

Changes from Previous Version

No structural changes between v8.0.1 and v8.0.2.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

NuGet marks this package as deprecated and points to CommunityToolkit.Aspire.Hosting.Dapr as an alternative.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.