Get started with the .NET / C# app integration
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
The Aspire Aspire.Hosting.Dotnet integration lets you add C# projects and file-based C# apps to your AppHost by path, without referencing a project from the AppHost’s own solution. It’s the C# peer of the Aspire.Hosting.Go, Aspire.Hosting.Python, and Aspire.Hosting.JavaScript hosting integrations.
Why use the Dotnet hosting integration
Section titled “Why use the Dotnet hosting integration”Adding C# apps by path through Aspire.Hosting.Dotnet gives you:
- Path-based orchestration for C#. Model a C# project or a file-based
.csapp in the AppHost the same way you’d model a Go, Python, or JavaScript app added by path, without adding the project to the AppHost’s solution. - File-based app support. Add a single
.csfile-based app (requires .NET 10 or later) directly, matching the file-based apps experience fordotnet run --file. - Familiar launch and configuration behavior. Endpoints, environment variables, and service discovery are configured from the project’s
launchSettings.jsonand Kestrel configuration, matchingAddProject<T>.
How the pieces fit together
Section titled “How the pieces fit together”The Dotnet integration is a hosting integration. You install it in the AppHost and use AddDotnetProject / addDotnetProject to add a C# project or file-based app resource by path.
-
Set up C# apps in the AppHost
Section titled “Set up C# apps in the AppHost”Add the
Aspire.Hosting.Dotnethosting integration to your AppHost, then useAddDotnetProject/addDotnetProjectto model a C# project or file-based app resource by path. The host reference covers package installation, path resolution, and launch behavior.Set up .NET / C# apps in the AppHost