Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ 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;

var builder = DistributedApplication.CreateBuilder(args);

IResourceBuilder<DotnetProjectResource> api =
builder.AddDotnetProject("api", "../api/api.csproj");
```
Comment thread
IEvangelist marked this conversation as resolved.

:::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**.
:::
Expand Down
Loading