Skip to content

Commit bcc8a6b

Browse files
authored
Add diagnostic articles (#3379)
* Add diagnostic articles * Add remaining diagnostics * Fix pine's silly rules
1 parent 5b8e4d3 commit bcc8a6b

14 files changed

+336
-13
lines changed

docs/diagnostics/aspire001.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Compiler Warning ASPIRE001
3+
description: Learn more about compiler Warning ASPIRE001. The code language isn't fully supported by Aspire - some code generation targets will not run, so will require manual authoring.
4+
ms.date: 05/08/2025
5+
f1_keywords:
6+
- "ASPIRE001"
7+
helpviewer_keywords:
8+
- "ASPIRE001"
9+
---
10+
11+
# Compiler Warning ASPIRE001
12+
13+
**Version introduced:** 8.0.0
14+
15+
> The 'CODELANGUAGE' language isn't fully supported by Aspire - some code generation targets will not run, so will require manual authoring.
16+
17+
This diagnostic warning is reported when using a code language other than C#.
18+
19+
## To correct this warning
20+
21+
In your .NET Aspire project, use C#.
22+
23+
## Suppress the warning
24+
25+
Suppress the warning with either of the following methods:
26+
27+
- Set the severity of the rule in the _.editorconfig_ file.
28+
29+
```ini
30+
[*.{cs,vb}]
31+
dotnet_diagnostic.ASPIRE001.severity = none
32+
```
33+
34+
For more information about editor config files, see [Configuration files for code analysis rules](/dotnet/fundamentals/code-analysis/configuration-files).
35+
36+
- Add the following `PropertyGroup` to your project file:
37+
38+
```xml
39+
<PropertyGroup>
40+
<NoWarn>$(NoWarn);ASPIRE001</NoWarn>
41+
</PropertyGroup>
42+
```

docs/diagnostics/aspire002.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: Compiler Warning ASPIRE002
3+
description: Learn more about compiler Warning ASPIRE002. Project is an Aspire AppHost project but necessary dependencies aren't present. Are you missing an Aspire.Hosting.AppHost PackageReference?
4+
ms.date: 05/08/2025
5+
f1_keywords:
6+
- "ASPIRE002"
7+
helpviewer_keywords:
8+
- "ASPIRE002"
9+
---
10+
11+
# Compiler Warning ASPIRE002
12+
13+
**Version introduced:** 8.0.0
14+
15+
> 'Project' is an Aspire AppHost project but necessary dependencies aren't present. Are you missing an Aspire.Hosting.AppHost PackageReference?
16+
17+
This diagnostic warning is reported when your project is missing reference to the .NET Aspire App Host.
18+
19+
## To correct this warning
20+
21+
Add reference to the [📦 Aspire.Hosting.AppHost](https://www.nuget.org/packages/Aspire.Hosting.AppHost) NuGet package. For more information about the app host, see [.NET Aspire orchestration overview](../fundamentals/app-host-overview.md).

docs/diagnostics/aspire003.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: Compiler Warning ASPIRE003
3+
description: Learn more about compiler Warning ASPIRE003. Project is a .NET Aspire AppHost project that requires Visual Studio version 17.10 or above to work correctly.
4+
ms.date: 05/08/2025
5+
f1_keywords:
6+
- "ASPIRE003"
7+
helpviewer_keywords:
8+
- "ASPIRE003"
9+
---
10+
11+
# Compiler Warning ASPIRE003
12+
13+
**Version introduced:** 8.0.0
14+
15+
> 'Project' is a .NET Aspire AppHost project that requires Visual Studio version 17.10 or above to work correctly.
16+
17+
When using Visual Studio to code your .NET Aspire project, you must have Visual Studio 2022 version 17.10 or later.
18+
19+
## To correct this warning
20+
21+
Upgrade Visual Studio 2022 to latest version, or at a minimum, version 17.20.

docs/diagnostics/aspire004.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Compiler Warning ASPIRE004
3+
description: Learn more about compiler Warning ASPIRE004. Project is referenced by an Aspire Host project, but it is not an executable.
4+
ms.date: 05/08/2025
5+
f1_keywords:
6+
- "ASPIRE004"
7+
helpviewer_keywords:
8+
- "ASPIRE004"
9+
---
10+
11+
# Compiler Warning ASPIRE004
12+
13+
**Version introduced:** 8.0.0
14+
15+
> 'Project' is referenced by an Aspire Host project, but it is not an executable. Did you mean to set IsAspireProjectResource="false"?
16+
17+
The project being referenced byt the .NET Aspire App Host isn't an executable, but is being treated like one for the purposes of orchestration.
18+
19+
## To correct this warning
20+
21+
Either change the build type of the project to an executable, or add the `IsAspireProjectResource="false"` setting to the project reference in your .NET Aspire App Host project file, as demonstrated in the following snippet:
22+
23+
```xml
24+
<ItemGroup>
25+
<ProjectReference Include="..\OtherProjects\Contracts.csproj" IsAspireProjectResource="false" />
26+
</ItemGroup>
27+
```
28+
29+
## Suppress the warning
30+
31+
Suppress the warning with either of the following methods:
32+
33+
- Set the severity of the rule in the _.editorconfig_ file.
34+
35+
```ini
36+
[*.{cs,vb}]
37+
dotnet_diagnostic.ASPIRE004.severity = none
38+
```
39+
40+
For more information about editor config files, see [Configuration files for code analysis rules](/dotnet/fundamentals/code-analysis/configuration-files).
41+
42+
- Add the following `PropertyGroup` to your project file:
43+
44+
```xml
45+
<PropertyGroup>
46+
<NoWarn>$(NoWarn);ASPIRE004</NoWarn>
47+
</PropertyGroup>
48+
```

docs/diagnostics/aspire007.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: Compiler Error ASPIRE007
3+
description: Learn more about compiler Error ASPIRE007. 'Project' requires a reference to "Aspire.AppHost.Sdk" with version "9.0.0" or greater to work correctly.
4+
ms.date: 05/08/2025
5+
f1_keywords:
6+
- "ASPIRE007"
7+
helpviewer_keywords:
8+
- "ASPIRE007"
9+
---
10+
11+
# Compiler Error ASPIRE007
12+
13+
**Version introduced:** 9.0.0
14+
15+
> 'Project' requires a reference to "Aspire.AppHost.Sdk" with version "9.0.0" or greater to work correctly. Please add the following line after the Project declaration `<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0" />`.
16+
17+
The .NET Aspire App Host package references require .NET Aspire SDK version 9.0.0 or greater. The SDK reference is either being omitted or is using a version older than 9.0.0.
18+
19+
## To correct this error
20+
21+
Update the referenced SDK version to 9.0.0 or the latest.
22+
23+
If the SDK reference is missing from your project file, add it, as demonstrated in the following snippet:
24+
25+
```xml
26+
<Project Sdk="Microsoft.NET.Sdk">
27+
28+
<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0" />
29+
30+
<PropertyGroup>
31+
<OutputType>Exe</OutputType>
32+
<TargetFramework>net9.0</TargetFramework>
33+
<ImplicitUsings>enable</ImplicitUsings>
34+
<Nullable>enable</Nullable>
35+
<IsAspireHost>true</IsAspireHost>
36+
</PropertyGroup>
37+
38+
<ItemGroup>
39+
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.2.0" />
40+
</ItemGroup>
41+
42+
</Project>
43+
```

docs/diagnostics/aspireacadomains001.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ builder.AddProject<Projects.AzureContainerApps_ApiService>("api")
4444

4545
Suppress the error with either of the following methods:
4646

47-
- Set the severity of the rule in the _.editorConfig_ file.
47+
- Set the severity of the rule in the _.editorconfig_ file.
4848

4949
```ini
5050
[*.{cs,vb}]

docs/diagnostics/aspireazure001.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ builder.AddAzurePublisher();
2828

2929
Suppress the Error with either of the following methods:
3030

31-
- Set the severity of the rule in the _.editorConfig_ file.
31+
- Set the severity of the rule in the _.editorconfig_ file.
3232

3333
```ini
3434
[*.{cs,vb}]

docs/diagnostics/aspirecompute001.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: Compiler Error ASPIRECOMPUTE001
3+
description: Learn more about compiler Error ASPIRECOMPUTE001. Compute related types and members are for evaluation purposes only and are subject to change or removal in future updates. Suppress this diagnostic to proceed.
4+
ms.date: 05/08/2025
5+
f1_keywords:
6+
- "ASPIRECOMPUTE001"
7+
helpviewer_keywords:
8+
- "ASPIRECOMPUTE001"
9+
---
10+
11+
# Compiler Error ASPIRECOMPUTE001
12+
13+
**Version introduced:** 9.3
14+
15+
> Compute related types and members are for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
16+
17+
## Example
18+
19+
The following code generates `ASPIRECOMPUTE001`:
20+
21+
```csharp
22+
var builder = DistributedApplication.CreateBuilder(args);
23+
24+
builder.AddDockerComposeEnvironment("env");
25+
// or
26+
builder.AddAzureContainerAppEnvironment("env")
27+
// or
28+
builder.AddKubernetesEnvironment("env")
29+
```
30+
31+
## To correct this Error
32+
33+
Suppress the Error with either of the following methods:
34+
35+
- Set the severity of the rule in the _.editorconfig_ file.
36+
37+
```ini
38+
[*.{cs,vb}]
39+
dotnet_diagnostic.ASPIRECOMPUTE001.severity = none
40+
```
41+
42+
For more information about editor config files, see [Configuration files for code analysis rules](/dotnet/fundamentals/code-analysis/configuration-files).
43+
44+
- Add the following `PropertyGroup` to your project file:
45+
46+
```xml
47+
<PropertyGroup>
48+
<NoWarn>$(NoWarn);ASPIRECOMPUTE001</NoWarn>
49+
</PropertyGroup>
50+
```
51+
52+
- Suppress in code with the `#pragma warning disable ASPIRECOMPUTE001` directive.

docs/diagnostics/aspirecosmosdb001.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var cosmos = builder.AddAzureCosmosDB("cosmos")
3737

3838
Suppress the Error with either of the following methods:
3939

40-
- Set the severity of the rule in the _.editorConfig_ file.
40+
- Set the severity of the rule in the _.editorconfig_ file.
4141

4242
```ini
4343
[*.{cs,vb}]

docs/diagnostics/aspirehostingpython001.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var pythonApp = builder.AddPythonApp("hello-python", "../hello-python", "main.py
3131

3232
Suppress the Error with either of the following methods:
3333

34-
- Set the severity of the rule in the _.editorConfig_ file.
34+
- Set the severity of the rule in the _.editorconfig_ file.
3535

3636
```ini
3737
[*.{cs,vb}]
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Compiler Error ASPIREPROXYENDPOINTS001
3+
description: Learn more about compiler Error ASPIREPROXYENDPOINTS001. Members are for evaluation purposes only and are subject to change or removal in future updates.
4+
ms.date: 05/08/2025
5+
f1_keywords:
6+
- "ASPIREPROXYENDPOINTS001"
7+
helpviewer_keywords:
8+
- "ASPIREPROXYENDPOINTS001"
9+
---
10+
11+
# Compiler Error ASPIREPROXYENDPOINTS001
12+
13+
**Version introduced:** 9.1
14+
15+
> `WithEndpointProxySupport` is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
16+
17+
-or-
18+
19+
> `ProxySupportAnnotation` is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
20+
21+
Both `WithEndpointProxySupport` and `ProxySupportAnnotation` are considered experimental APIs.
22+
23+
Container resources use proxied endpoints by default. Adjusting this setting is experimental. For more information, see <xref:Aspire.Hosting.ContainerResourceBuilderExtensions.WithEndpointProxySupport*>.
24+
25+
## Example
26+
27+
The following code generates `ASPIREPROXYENDPOINTS001`:
28+
29+
```csharp
30+
var builder = DistributedApplication.CreateBuilder(args);
31+
32+
var redis = builder.AddRedis($"example-redis", 1234)
33+
.WithEndpointProxySupport(false);
34+
```
35+
36+
## To correct this Error
37+
38+
Suppress the Error with either of the following methods:
39+
40+
- Set the severity of the rule in the _.editorconfig_ file.
41+
42+
```ini
43+
[*.{cs,vb}]
44+
dotnet_diagnostic.ASPIREPROXYENDPOINTS001.severity = none
45+
```
46+
47+
For more information about editor config files, see [Configuration files for code analysis rules](/dotnet/fundamentals/code-analysis/configuration-files).
48+
49+
- Add the following `PropertyGroup` to your project file:
50+
51+
```xml
52+
<PropertyGroup>
53+
<NoWarn>$(NoWarn);ASPIREPROXYENDPOINTS001</NoWarn>
54+
</PropertyGroup>
55+
```
56+
57+
- Suppress in code with the `#pragma warning disable ASPIREPROXYENDPOINTS001` directive.

docs/diagnostics/aspirepublishers001.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Publishers are considered experimental and are expected to change in the future.
2222

2323
Suppress the Error with either of the following methods:
2424

25-
- Set the severity of the rule in the _.editorConfig_ file.
25+
- Set the severity of the rule in the _.editorconfig_ file.
2626

2727
```ini
2828
[*.{cs,vb}]

docs/diagnostics/overview.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,18 @@ ms.date: 04/15/2025
99

1010
The following table lists the possible MSBuild and .NET Analyzer warnings and errors you might encounter with .NET Aspire:
1111

12-
| Diagnostic ID | Type | Description |
13-
|-------------------------------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
14-
| [`ASPIRE006`](ASPIRE006.md) | (Experimental) Error | <span id="ASPIRE006"></span> Application model items must have valid names. |
15-
| [`ASPIREACADOMAINS001`](ASPIREACADOMAINS001.md) | (Experimental) Error | <span id="ASPIREACADOMAINS001"></span> `ConfigureCustomDomain` is for evaluation purposes only and is subject to change or removal in future updates. |
16-
| [`ASPIREAZURE001`](ASPIREAZURE001.md) | (Experimental) Error | <span id="ASPIREAZURE001"></span> Publishers are for evaluation purposes only and are subject to change or removal in future updates. |
17-
| [`ASPIRECOSMOSDB001`](ASPIRECOSMOSDB001.md) | (Experimental) Error | <span id="ASPIRECOSMOSDB001"></span> `RunAsPreviewEmulator` is for evaluation purposes only and is subject to change or removal in future updates. |
18-
| [`ASPIREHOSTINGPYTHON001`](ASPIREHOSTINGPYTHON001.md) | (Experimental) Error | <span id="ASPIREHOSTINGPYTHON001"></span> `AddPythonApp` is for evaluation purposes only and is subject to change or removal in future updates. |
19-
| [`ASPIREPUBLISHERS001`](ASPIREPUBLISHERS001.md) | Error | <span id="ASPIREPUBLISHERS001"></span> Publishers are for evaluation purposes only and are subject to change or removal in future updates. |
12+
| Diagnostic ID | Type | Description |
13+
|---------------------------------------------------------|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
14+
| [`ASPIRE001`](aspire001.md) | Warning | <span id="ASPIRE001"></span> The code language isn't fully supported by Aspire, some code generation targets will not run. |
15+
| [`ASPIRE002`](aspire002.md) | Warning | <span id="ASPIRE002"></span> Project is an Aspire AppHost project but necessary dependencies aren't present. Are you missing an Aspire.Hosting.AppHost PackageReference? |
16+
| [`ASPIRE003`](aspire003.md) | Warning | <span id="ASPIRE003"></span> 'Project' is a .NET Aspire AppHost project that requires Visual Studio version 17.10 or above to work correctly. |
17+
| [`ASPIRE004`](aspire004.md) | Warning | <span id="ASPIRE004"></span> 'Project' is referenced by an Aspire Host project, but it is not an executable. |
18+
| [`ASPIRE006`](aspire006.md) | (Experimental) Error | <span id="ASPIRE006"></span> Application model items must have valid names. |
19+
| [`ASPIRE007`](aspire007.md) | Error | <span id="ASPIRE007"></span> 'Project' requires a reference to "Aspire.AppHost.Sdk" with version "9.0.0" or greater to work correctly. |
20+
| [`ASPIREACADOMAINS001`](aspireacadomains001.md) | (Experimental) Error | <span id="ASPIREACADOMAINS001"></span> `ConfigureCustomDomain` is for evaluation purposes only and is subject to change or removal in future updates. |
21+
| [`ASPIREAZURE001`](aspireazure001.md) | (Experimental) Error | <span id="ASPIREAZURE001"></span> Publishers are for evaluation purposes only and are subject to change or removal in future updates. |
22+
| [`ASPIRECOMPUTE001`](aspirecompute001.md) | (Experimental) Error | <span id="ASPIRECOMPUTE001"></span> Compute related types and members are for evaluation purposes only and is subject to change or removal in future updates. |
23+
| [`ASPIRECOSMOSDB001`](aspirecosmosdb001.md) | (Experimental) Error | <span id="ASPIRECOSMOSDB001"></span> `RunAsPreviewEmulator` is for evaluation purposes only and is subject to change or removal in future updates. |
24+
| [`ASPIREHOSTINGPYTHON001`](aspirehostingpython001.md) | (Experimental) Error | <span id="ASPIREHOSTINGPYTHON001"></span> `AddPythonApp` is for evaluation purposes only and is subject to change or removal in future updates. |
25+
| [`ASPIREPROXYENDPOINTS001`](aspireproxyendpoints001.md) | (Experimental) Error | <span id="ASPIREPROXYENDPOINTS001"></span> ProxyEndpoint members are for evaluation purposes only and are subject to change or removal in future updates. |
26+
| [`ASPIREPUBLISHERS001`](aspirepublishers001.md) | Error | <span id="ASPIREPUBLISHERS001"></span> Publishers are for evaluation purposes only and are subject to change or removal in future updates. |

0 commit comments

Comments
 (0)