A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dotnet-aspire-sdk below:

.NET Aspire SDK - .NET Aspire

The .NET Aspire SDK is intended for *.AppHost projects, which serve as the .NET Aspire orchestrator. These projects are designated by their usage of the Aspire.AppHost.Sdk in the project file. The SDK provides a set of features that simplify the development of .NET Aspire apps.

Overview

The 📦 Aspire.AppHost.Sdk is an additive MSBuild project SDK for building .NET Aspire apps. The Aspire.AppHost.Sdk is defined with a top-level Project/Sdk:

<Project Sdk="Microsoft.NET.Sdk">

    <Sdk Name="Aspire.AppHost.Sdk" Version="9.4.0" />
    
    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net9.0</TargetFramework>
        <!-- Omitted for brevity -->
    </PropertyGroup>
    
    <ItemGroup>
        <PackageReference Include="Aspire.Hosting.AppHost" Version="9.4.0" />
    </ItemGroup>

    <!-- Omitted for brevity -->
</Project>

The preceding example project defines the top-level SDK as Microsoft.NET.Sdk and the Aspire.AppHost.Sdk as an additive SDK. The project also references the Aspire.Hosting.AppHost package which brings in a number of Aspire-related dependencies.

SDK Features

The .NET Aspire SDK provides several key features.

Project references

Each ProjectReference in the .NET Aspire AppHost project isn't treated as standard project references. Instead, they enable the AppHost to execute these projects as part of its orchestration. Each project reference triggers a generator to create a class that represents the project as an IProjectMetadata. This metadata is used to populate the named projects in the generated Projects namespace. When you call the Aspire.Hosting.ProjectResourceBuilderExtensions.AddProject API, the Projects namespace is used to reference the project—passing the generated class as a generic-type parameter.

Tip

If you need to reference a project in the traditional way within the AppHost, set the IsAspireProjectResource attribute on the ProjectReference element to false, as shown in the following example:

<ProjectReference Include="..\MyProject\MyProject.csproj" IsAspireProjectResource="false" />

Otherwise, by default, the ProjectReference is treated as .NET Aspire project resource.

Orchestrator dependencies

The .NET Aspire SDK dynamically adds references to the .NET Aspire dashboard and other AppHost dependencies, such as the developer control plane (DCP) packages. These dependencies are specific to the platform that the AppHost is built on.

When the AppHost project runs, the orchestrator relies on these dependencies to provide the necessary functionality to the AppHost. For more information, see .NET Aspire orchestration overview.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4