Skip to content
Merged
Show file tree
Hide file tree
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
@@ -1,10 +1,10 @@
---
title: Compiler Warning ASPIREDOTNETPROJECT001
seoTitle: 'ASPIREDOTNETPROJECT001: AddDotnetProject types and members'
description: Learn what causes the Aspire compiler warning ASPIREDOTNETPROJECT001 and how to fix it so your AppHost builds cleanly.
description: Learn why Aspire 13.6 removed ASPIREDOTNETPROJECT001 from the prerelease Dotnet and Blazor hosting packages while their APIs remain unstable.
Comment thread
eerhardt marked this conversation as resolved.
---

import { Badge, Aside } from '@astrojs/starlight/components';
import { Badge } from '@astrojs/starlight/components';

<Badge
text="Version introduced: 13.5"
Expand All @@ -13,22 +13,27 @@ import { Badge, Aside } from '@astrojs/starlight/components';
class:list={'mb-1'}
/>

<Aside type="note">
`AddDotnetProject`, `DotnetProjectResource`, and the related `WithBuildEnvironment` overloads don't trigger `ASPIREDOTNETPROJECT001` when using Aspire 13.6 or later. `Aspire.Hosting.Dotnet` is a prerelease package, so its API surface may change before it ships stable. The separate `AddDotnetProjectBlazorGateway` and matching `WithBlazorClientApp` overload in `Aspire.Hosting.Blazor` carry this diagnostic.
</Aside>
:::note[Removed in Aspire 13.6]
`Aspire.Hosting.Dotnet` and `Aspire.Hosting.Blazor` are already prerelease packages, so the separate `ASPIREDOTNETPROJECT001` experimental designation was unnecessary. Their APIs remain unstable and may change in future releases.

Starting with Aspire 13.6, `AddDotnetProject`, `DotnetProjectResource`, and the related `WithBuildEnvironment` overloads no longer emit `ASPIREDOTNETPROJECT001`. You can remove suppressions for these APIs after upgrading.

`AddDotnetProjectBlazorGateway` and the matching `WithBlazorClientApp` overload in `Aspire.Hosting.Blazor` also no longer emit this diagnostic. The separate [`ASPIREBLAZOR001`](/diagnostics/aspireblazor001/) diagnostic still applies to experimental Blazor hosting types.
:::

> AddDotnetProject types and members are for evaluation purposes only and are subject to change or removal in future updates. Suppress this diagnostic to proceed.

In Aspire 13.5, this diagnostic is reported when using the following experimental APIs from `Aspire.Hosting.Dotnet`:

- `AddDotnetProject` extension methods
- `DotnetProjectResource`
- `WithBuildEnvironment` overloads for `DotnetProjectResource`

These APIs add a C# project or file-based C# app to the application model as an `ExecutableResource` that's launched through the .NET SDK.
These APIs add and configure a C# project or file-based C# app in the application model as an `ExecutableResource` that's launched through the .NET SDK.

## Example in Aspire 13.5

The following code generates `ASPIREDOTNETPROJECT001`:
In Aspire 13.5, the following code generates `ASPIREDOTNETPROJECT001`:

```csharp title="AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);
Expand All @@ -40,9 +45,9 @@ builder.Build().Run();

## To correct this warning

If you use Aspire 13.6 or later, these APIs don't need a diagnostic suppression. Remove suppressions that were added for them.
Upgrade to Aspire 13.6 or later. After upgrading, remove `ASPIREDOTNETPROJECT001` suppressions from _.editorconfig_ files, project `NoWarn` properties, and `#pragma warning` directives. Keep any required suppressions for other diagnostics, including `ASPIREBLAZOR001`.

For earlier versions, or the still-experimental [Dotnet project Blazor gateway](/integrations/dotnet/blazor-hosting/#add-a-blazor-gateway-for-a-c-project-resource), suppress the warning with one of the following methods:
For earlier versions, suppress the warning with one of the following methods:

- Set the severity of the rule in the _.editorconfig_ file.

Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/content/docs/diagnostics/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The following table lists the possible MSBuild and analyzer warnings and errors
| [ASPIRECOSMOSDB001](/diagnostics/aspirecosmosdb001/) | (Experimental) Error | `RunAsPreviewEmulator` is for evaluation purposes only and is subject to change or removal in future updates. |
| [ASPIRECSHARPAPPS001](/diagnostics/aspirecsharpapps001/) | (Experimental) Error | `AddCSharpApp` is for evaluation purposes only and is subject to change or removal in future updates. |
| [ASPIREDOCKERFILEBUILDER001](/diagnostics/aspiredockerfilebuilder001/) | (Experimental) Warning | Dockerfile builder types and members are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREDOTNETPROJECT001](/diagnostics/aspiredotnetproject001/) | (Experimental) Warning | `AddDotnetProject` types and members are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREDOTNETPROJECT001](/diagnostics/aspiredotnetproject001/) | (Experimental) Warning | Removed from the prerelease `Aspire.Hosting.Dotnet` and `Aspire.Hosting.Blazor` packages in Aspire 13.6. Their APIs remain unstable and may change. |
Comment thread
eerhardt marked this conversation as resolved.
| [ASPIREDOTNETTOOL001](/diagnostics/aspiredotnettool001/) | (Experimental) Warning | .NET tool resource types and members are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREEXTENSION001](/diagnostics/aspireextension001/) | (Experimental) Warning | Extension debugging support APIs are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREFILESYSTEM001](/diagnostics/aspirefilesystem001/) | (Experimental) Warning | File system service types and members are for evaluation purposes only and are subject to change or removal in future updates. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ await builder.build().run();
```csharp title="AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);

#pragma warning disable ASPIREBLAZOR001, ASPIREDOTNETPROJECT001
#pragma warning disable ASPIREBLAZOR001
Comment thread
eerhardt marked this conversation as resolved.

var client = builder.AddBlazorWasmProject<Projects.Client>("client");

Expand All @@ -252,16 +252,13 @@ builder.Build().Run();
</TabItem>
</Tabs>

<Aside type="caution" title="Experimental">
`AddDotnetProjectBlazorGateway` and its `WithBlazorClientApp` overload
report their own `ASPIREDOTNETPROJECT001` diagnostic. The Blazor
integration's `ASPIREBLAZOR001` diagnostic applies to other experimental
Blazor hosting types, such as `BlazorWasmAppResource`. These gateway APIs are
experimental independently of the core Dotnet project APIs. This gateway
runs as a file-based C# app and supports both `aspire run` and publishing.
For details on suppressing the diagnostic, see
[ASPIREDOTNETPROJECT001](/diagnostics/aspiredotnetproject001/).
</Aside>
:::note
`Aspire.Hosting.Blazor` is a prerelease package. Its APIs remain unstable and may change in future releases.

Starting with Aspire 13.6, `AddDotnetProjectBlazorGateway` and its `WithBlazorClientApp` overload no longer emit [`ASPIREDOTNETPROJECT001`](/diagnostics/aspiredotnetproject001/). You can remove existing suppressions for this diagnostic after upgrading.

The separate [`ASPIREBLAZOR001`](/diagnostics/aspireblazor001/) diagnostic still applies to experimental Blazor hosting types, such as `BlazorWasmAppResource`. Keep the `ASPIREBLAZOR001` suppression in the example.
:::

The gateway forwards the client's service references and supports publishing through the shared Blazor client attachment and publish-companion pipeline. Browser-debugger resources are created only for local runs.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import csharpIcon from '@assets/icons/csharp.svg';
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.

:::note
`Aspire.Hosting.Dotnet` is a prerelease package. `AddDotnetProject` / `addDotnetProject` doesn't require suppressing `ASPIREDOTNETPROJECT001`, but the API surface may change. The separate [Dotnet project Blazor gateway](/integrations/dotnet/blazor-hosting/#add-a-blazor-gateway-for-a-c-project-resource) is experimental.
`Aspire.Hosting.Dotnet` is a prerelease package. Its APIs remain unstable and may change in future releases.

Starting with Aspire 13.6, `AddDotnetProject` / `addDotnetProject` no longer requires suppressing [`ASPIREDOTNETPROJECT001`](/diagnostics/aspiredotnetproject001/). You can remove existing suppressions for these APIs after upgrading.
Comment thread
eerhardt marked this conversation as resolved.
:::

## Why use the Dotnet hosting integration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ This article is the reference for the Aspire Dotnet hosting integration. It enum
If you're new to the Dotnet integration, start with the [Get started with the .NET / C# app integration](/integrations/frameworks/dotnet/dotnet-get-started/) guide.

:::note
`Aspire.Hosting.Dotnet` is a prerelease package. `AddDotnetProject`, `DotnetProjectResource`, and the related `WithBuildEnvironment` overloads don't require suppressing `ASPIREDOTNETPROJECT001`, but the API surface may change. The separate [Dotnet project Blazor gateway](/integrations/dotnet/blazor-hosting/#add-a-blazor-gateway-for-a-c-project-resource) is experimental.
`Aspire.Hosting.Dotnet` is a prerelease package. Its APIs remain unstable and may change in future releases.

Starting with Aspire 13.6, `AddDotnetProject`, `DotnetProjectResource`, and the related `WithBuildEnvironment` overloads no longer require suppressing [`ASPIREDOTNETPROJECT001`](/diagnostics/aspiredotnetproject001/). You can remove existing suppressions for these APIs after upgrading.
:::

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:
Expand Down
8 changes: 6 additions & 2 deletions src/frontend/src/content/docs/whats-new/aspire-13-6.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,11 @@ builder.Build().Run();
</TabItem>
</Tabs>

`AddDotnetProject`, `DotnetProjectResource`, and the related `WithBuildEnvironment` overloads no longer require `ASPIREDOTNETPROJECT001` suppression in 13.6. The package remains prerelease; the separate Dotnet project Blazor gateway retains its experimental diagnostics. Projects that depend on per-project restore hooks can opt into individual restore with `Aspire:Dotnet:RestoreProjectsIndividually` in the AppHost configuration.
`AddDotnetProject`, `DotnetProjectResource`, and the related `WithBuildEnvironment` overloads no longer require [`ASPIREDOTNETPROJECT001`](/diagnostics/aspiredotnetproject001/) suppression in Aspire 13.6. This diagnostic was unnecessary for `Aspire.Hosting.Dotnet` because the package is already prerelease. Its APIs remain unstable and may change in future releases.

The diagnostic is also removed from `AddDotnetProjectBlazorGateway` and its `WithBlazorClientApp` overload in `Aspire.Hosting.Blazor`. This package also remains prerelease, and its APIs remain unstable and may change. The separate [`ASPIREBLAZOR001`](/diagnostics/aspireblazor001/) diagnostic still applies to experimental Blazor hosting types.
Comment thread
eerhardt marked this conversation as resolved.

Projects that depend on per-project restore hooks can opt into individual restore with `Aspire:Dotnet:RestoreProjectsIndividually` in the AppHost configuration.

Aspire also enables MSBuild's multithreaded task execution (`-mt`) when the selected SDK supports it. Project and traversal builds require .NET SDK `11.0.100-rc.1` or later; file-based apps require `11.0.100-rtm.26473.104` or a stable `11.0.100` or later. Older or undetected SDKs keep the existing behavior.

Expand Down Expand Up @@ -702,7 +706,7 @@ Existing integrations add new workflows and safer defaults:
- **MongoDB automatic TLS.** Local MongoDB resources now use Aspire's shared certificate configuration, including standalone servers. Existing plaintext clients should review the [TLS migration guidance](#mongodb-now-uses-automatic-tls-during-local-runs).
- **Microsoft Foundry Toolboxes.** `AddToolbox` / `addToolbox` bundles tools behind one MCP endpoint and manages immutable versions as tool configuration changes. MCP approval policies are discovery metadata that the consuming application must enforce. See the [Toolbox walkthrough](/integrations/cloud/azure/azure-ai-foundry/azure-ai-foundry-host/#add-a-toolbox).
- **Remote Foundry Local services.** `RunAsFoundryLocal` / `runAsFoundryLocal` now accepts an endpoint, so an AppHost, including one on WSL2 or Linux, can observe a Foundry Local service already running on another host (for example, a Windows GPU box) without starting, stopping, or downloading models on it. The integration also handles the newer `foundry server` CLI generation. See [Connect to a remote Foundry Local service](/integrations/cloud/azure/azure-ai-foundry/azure-ai-foundry-host/#connect-to-a-remote-foundry-local-service).
- **Blazor WebAssembly debugging.** Standalone and hosted WebAssembly apps can expose dashboard commands for starting and stopping an Edge or Chrome debugging session during local runs. The related Dotnet project gateway APIs are also available to polyglot AppHosts and participate in publishing, but remain experimental. See [Blazor gateway hosting](/integrations/dotnet/blazor-hosting/#add-a-blazor-gateway-for-a-c-project-resource).
- **Blazor WebAssembly debugging.** Standalone and hosted WebAssembly apps can expose dashboard commands for starting and stopping an Edge or Chrome debugging session during local runs. The related Dotnet project gateway APIs are also available to polyglot AppHosts and participate in publishing, but remain unstable and may change. See [Blazor gateway hosting](/integrations/dotnet/blazor-hosting/#add-a-blazor-gateway-for-a-c-project-resource).
- **Dev Tunnel discovery and expiration.** Tunnel, inspect, and local endpoint URLs appear as highlighted resource properties, and a **Show tunnel URLs** command surfaces them through the dashboard Interaction Service. `WithExpiration` / `withExpiration` also configures idle expiration for new or reused tunnels, in whole hours from one hour through 30 days.
- **Radius recipe configuration.** Experimental APIs configure recipe parameters and required secrets globally or per resource from the AppHost. The integration now recommends [Radius v0.60.2](https://github.com/radius-project/radius/releases/tag/v0.60.2); v0.60.0 remains the minimum supported control-plane version.
- **Radius backing connections.** Consumer addresses and credentials now come from the backing resource's deployed schema and recipe outputs rather than local endpoint guesses. New publish diagnostics catch unsupported endpoints, database mappings, credentials, and secret collisions. Review the [Radius deployment guide](/deployment/radius/) before upgrading.
Expand Down
Loading