From bd6b44cfa7ced35d38be601de094d388cfb8474e Mon Sep 17 00:00:00 2001 From: "aspire-repo-bot[bot]" <268009190+aspire-repo-bot[bot]@users.noreply.github.com> Date: Wed, 12 Aug 2026 01:10:59 +0000 Subject: [PATCH 1/2] docs: document DotnetProjectResource namespace move to Aspire.Hosting.Dotnet Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../docs/integrations/frameworks/dotnet/dotnet-host.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/frontend/src/content/docs/integrations/frameworks/dotnet/dotnet-host.mdx b/src/frontend/src/content/docs/integrations/frameworks/dotnet/dotnet-host.mdx index e08076ff5..aa115bca9 100644 --- a/src/frontend/src/content/docs/integrations/frameworks/dotnet/dotnet-host.mdx +++ b/src/frontend/src/content/docs/integrations/frameworks/dotnet/dotnet-host.mdx @@ -27,6 +27,15 @@ If you're new to the Dotnet integration, start with the [Get started with the .N `AddDotnetProject` / `addDotnetProject` is experimental and exposed under the `ASPIREDOTNETPROJECT001` diagnostic. Its API surface may change in future releases. ::: +If your C# AppHost needs to reference the resource type directly — for example, to declare a strongly typed variable or a method parameter — import it from the `Aspire.Hosting.Dotnet` namespace, matching the pattern used by the Go, Python, and JavaScript hosting integrations: + +```csharp +using Aspire.Hosting.Dotnet; + +IResourceBuilder api = + builder.AddDotnetProject("api", "../api/api.csproj"); +``` + :::note[Prerequisites] The **.NET SDK** must be available on the `PATH` of the machine running the AppHost. File-based C# apps (`.cs`) require **.NET 10 or later**. ::: From ba78292b83c646c781288723b20b046b8049bd46 Mon Sep 17 00:00:00 2001 From: David Pine <7679720+IEvangelist@users.noreply.github.com> Date: Tue, 11 Aug 2026 20:50:53 -0500 Subject: [PATCH 2/2] docs: define AppHost builder in .NET sample Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 32c349b4-907d-42e9-aad8-2f0edc267779 --- .../content/docs/integrations/frameworks/dotnet/dotnet-host.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/frontend/src/content/docs/integrations/frameworks/dotnet/dotnet-host.mdx b/src/frontend/src/content/docs/integrations/frameworks/dotnet/dotnet-host.mdx index aa115bca9..af3c9c8fa 100644 --- a/src/frontend/src/content/docs/integrations/frameworks/dotnet/dotnet-host.mdx +++ b/src/frontend/src/content/docs/integrations/frameworks/dotnet/dotnet-host.mdx @@ -32,6 +32,8 @@ If your C# AppHost needs to reference the resource type directly — for example ```csharp using Aspire.Hosting.Dotnet; +var builder = DistributedApplication.CreateBuilder(args); + IResourceBuilder api = builder.AddDotnetProject("api", "../api/api.csproj"); ```