# Compiler Warning ASPIREDOTNETPROJECT001

<Badge
  text="Version introduced: 13.5"
  variant="note"
  size="large"
  class:list={'mb-1'}
/>

:::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, <ApiReference name="Aspire.Hosting.DotnetProjectHostingExtensions.AddDotnetProject" />, `DotnetProjectResource`, and the related <ApiReference name="Aspire.Hosting.DotnetProjectHostingExtensions.WithBuildEnvironment" /> overloads no longer emit `ASPIREDOTNETPROJECT001`. You can remove suppressions for these APIs after upgrading.

<ApiReference name="Aspire.Hosting.BlazorGatewayExtensions.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 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

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

```csharp title="AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);

builder.AddDotnetProject("inventoryservice", @"..\InventoryService.cs");

builder.Build().Run();
```

## To correct this warning

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, suppress the warning with one of the following methods:

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

  ```ini title=".editorconfig"
  [*.{cs,vb}]
  dotnet_diagnostic.ASPIREDOTNETPROJECT001.severity = none
  ```

  For more information about editor config files, see [Configuration files for code analysis rules](/diagnostics/overview/#suppress-in-the-editorconfig-file).

- Add the following `PropertyGroup` to your project file:

  ```xml title="C# project file"
  <PropertyGroup>
      <NoWarn>$(NoWarn);ASPIREDOTNETPROJECT001</NoWarn>
  </PropertyGroup>
  ```

- Suppress in code with the `#pragma warning disable ASPIREDOTNETPROJECT001` directive:

  ```csharp title="Suppressing the warning"
  #pragma warning disable ASPIREDOTNETPROJECT001
  builder.AddDotnetProject("inventoryservice", @"..\InventoryService.cs");
  #pragma warning restore ASPIREDOTNETPROJECT001
  ```

## See also

- [ASPIRECSHARPAPPS001](/diagnostics/aspirecsharpapps001/) - Related experimental C# app API
- [ASPIREPROJECTS001](/diagnostics/aspireprojects001/) - Related experimental project launch defaults APIs