This example shows a .NET Aspire Dashboard integrated into an ASP.NET Core Document Viewer application.
To work with .NET Aspire, you need the following:
- .NET 8.0 or .NET 9.0
- .NET Aspire SDK
- Visual Studio 2022 version 17.9+
- .NET Aspire Dashboard application. Refer to the following help topic for information on how to create the application: Quick Start: Build your first .NET Aspire solution
- DevExpress Reports-powered application. Refer to the following section for tutorials on how to create an ASP.NET Core Report Viewer: Use Reporting Components
Reference the following NuGet packages in your Reporting application:
DevExpress.Aspire.Reporting
DevExpress.Aspire.AspNetCore.Reporting
-
Add the following project references:
Project Reference AppHost/Orchestration project (usually with an *.AppHost suffix) DevExpress Reports application DevExpress Reports application ServiceDefaults application -
Open your reporting project. Add the following method calls to
Program.cs
:var builder = WebApplication.CreateBuilder(args); builder.Services.AddDevExpressControls(); // Important note: Enable .NET Aspire integration after an AddDevExpressControls method call // Enable service discovery and configure OpenTelemetry metrics and tracing for .NET Aspire. // Learn more at: https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/service-defaults builder.AddServiceDefaults(); // Share trace data with the .NET Aspire Dashboard from DevExpress Reports document creation and exporting builder.AddReporting(); // Share trace and metrics data with the .NET Aspire Dashboard for the DevExpress Reports back end services builder.AddAspNetCoreReporting();
-
Navigate to the
AppHost
project. Add the following project reference code toProgram.cs
:var builder = DistributedApplication.CreateBuilder(args); builder.AddProject<Projects.DevExpressReportingApp>("webreporting") .WithExternalHttpEndpoints(); builder.Build().Run();
-
Build and run the *.AppHost solution to view output in the .NET Aspire dashboard.
(you will be redirected to DevExpress.com to submit your response)