Skip to content

Commit ef2ab8a

Browse files
Merge pull request #3163 from dotnet/main
✅ Merge `main` into `live`
2 parents efe9c15 + 7f0e564 commit ef2ab8a

11 files changed

+355
-201
lines changed

docfx.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@
9797
},
9898
"fileMetadata": {
9999
"ms.topic": {
100-
"docs/**/*.md": "conceptual"
100+
"docs/**/*.md": "conceptual",
101+
"docs/diagnostics/*.md": "error-reference"
101102
},
102103
"ms.devlang": {
103104
"docs/**/*.*": "csharp"

docs/diagnostics/aspire006.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Compiler Error ASPIRE006
3+
description: Learn more about compiler Error ASPIRE006. Application model items must have valid names.
4+
ms.date: 04/21/2025
5+
f1_keywords:
6+
- "ASPIRE006"
7+
helpviewer_keywords:
8+
- "ASPIRE006"
9+
---
10+
11+
# Compiler Error ASPIRE006
12+
13+
**Version introduced:** 8.2.2
14+
15+
> Application model items must have valid names.
16+
17+
This diagnostic error is reported when a resource's name is invalid, such as a name with consecutive hyphen (`-`) characters.
18+
19+
This error shouldn't be suppressed, as invalid model names throw an exception at runtime.
20+
21+
## Example
22+
23+
The following code generates `ASPIRE006`:
24+
25+
```csharp
26+
var bbsContainer = builder.AddContainer("bbs--server", "coldwall/mystic")
27+
.WithEndpoint(19991, 23);
28+
```
29+
30+
## To correct this Error
31+
32+
Use a valid name. For more information, see [Resource naming conventions](../fundamentals/orchestrate-resources.md#resource-naming-conventions).
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: Compiler Error ASPIREACADOMAINS001
3+
description: Learn more about compiler Error ASPIREACADOMAINS001. `ConfigureCustomDomain` is for evaluation purposes only and is subject to change or removal in future updates.
4+
ms.date: 04/21/2025
5+
f1_keywords:
6+
- "ASPIREACADOMAINS001"
7+
helpviewer_keywords:
8+
- "ASPIREACADOMAINS001"
9+
---
10+
11+
# Compiler Error ASPIREACADOMAINS001
12+
13+
**Version introduced:** 9.0
14+
15+
> `ConfigureCustomDomain` is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
16+
17+
.NET Aspire 9.0 introduces the ability to customize container app resources using any of the following extension methods:
18+
19+
- `Aspire.Hosting.AzureContainerAppProjectExtensions.PublishAsAzureContainerApp`
20+
- `Aspire.Hosting.AzureContainerAppContainerExtensions.PublishAsAzureContainerApp`
21+
- `Aspire.Hosting.AzureContainerAppExecutableExtensions.PublishAsAzureContainerApp`
22+
23+
When you use one of these methods, the Azure Developer CLI (`azd`) can no longer preserve custom domains. Instead use the `Aspire.Hosting.ContainerAppExtensions.ConfigureCustomDomain` method to configure a custom domain within the .NET Aspire app host.
24+
25+
However, `app.ConfigureCustomDomain` is an experimental API and you must suppress it to use it.
26+
27+
## Example
28+
29+
The following code generates `ASPIREACADOMAINS001`:
30+
31+
```csharp
32+
var customDomain = builder.AddParameter("customDomain");
33+
var certificateName = builder.AddParameter("certificateName");
34+
35+
builder.AddProject<Projects.AzureContainerApps_ApiService>("api")
36+
.WithExternalHttpEndpoints()
37+
.PublishAsAzureContainerApp((infra, app) =>
38+
{
39+
app.ConfigureCustomDomain(customDomain, certificateName);
40+
});
41+
```
42+
43+
## To correct this error
44+
45+
Suppress the error with either of the following methods:
46+
47+
- Set the severity of the rule in the _.editorConfig_ file.
48+
49+
```ini
50+
[*.{cs,vb}]
51+
dotnet_diagnostic.ASPIREACADOMAINS001.severity = none
52+
```
53+
54+
For more information about editor config files, see [Configuration files for code analysis rules](/dotnet/fundamentals/code-analysis/configuration-files).
55+
56+
- Add the following `PropertyGroup` to your project file:
57+
58+
```xml
59+
<PropertyGroup>
60+
<NoWarn>$(NoWarn);ASPIREACADOMAINS001</NoWarn>
61+
</PropertyGroup>
62+
```
63+
64+
- Suppress in code with the `#pragma warning disable ASPIREACADOMAINS001` directive.

docs/diagnostics/aspireazure001.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Compiler Error ASPIREAZURE001
3+
description: Learn more about compiler Error ASPIREAZURE001. Publishers are for evaluation purposes only and are subject to change or removal in future updates.
4+
ms.date: 04/21/2025
5+
f1_keywords:
6+
- "ASPIREAZURE001"
7+
helpviewer_keywords:
8+
- "ASPIREAZURE001"
9+
---
10+
11+
# Compiler Error ASPIREAZURE001
12+
13+
**Version introduced:** 9.2
14+
15+
> Publishers are for evaluation purposes only and are subject to change or removal in future updates. Suppress this diagnostic to proceed.
16+
17+
The .NET Aspire Azure hosting integration now ships with a publisher. If you're using any of the <xref:Aspire.Hosting.AzurePublisherExtensions.AddAzurePublisher*> APIs, you might see a compiler error/warning indicating that the API is experimental. This behavior is expected, as the API is still in preview and the shape of this API is expected to change in the future.
18+
19+
## Example
20+
21+
The following code generates `ASPIREAZURE001`:
22+
23+
```csharp
24+
builder.AddAzurePublisher();
25+
```
26+
27+
## To correct this Error
28+
29+
Suppress the Error with either of the following methods:
30+
31+
- Set the severity of the rule in the _.editorConfig_ file.
32+
33+
```ini
34+
[*.{cs,vb}]
35+
dotnet_diagnostic.ASPIREAZURE001.severity = none
36+
```
37+
38+
For more information about editor config files, see [Configuration files for code analysis rules](/dotnet/fundamentals/code-analysis/configuration-files).
39+
40+
- Add the following `PropertyGroup` to your project file:
41+
42+
```xml
43+
<PropertyGroup>
44+
<NoWarn>$(NoWarn);ASPIREAZURE001</NoWarn>
45+
</PropertyGroup>
46+
```
47+
48+
- Suppress in code with the `#pragma warning disable ASPIREAZURE001` directive.

docs/diagnostics/aspirecosmosdb001.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Compiler Error ASPIRECOSMOSDB001
3+
description: Learn more about compiler Error ASPIRECOSMOSDB001. `RunAsPreviewEmulator` is for evaluation purposes only and is subject to change or removal in future updates.
4+
ms.date: 04/21/2025
5+
f1_keywords:
6+
- "ASPIRECOSMOSDB001"
7+
helpviewer_keywords:
8+
- "ASPIRECOSMOSDB001"
9+
---
10+
11+
# Compiler Error ASPIRECOSMOSDB001
12+
13+
**Version introduced:** 9.0
14+
15+
> `RunAsPreviewEmulator` 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+
> `WithDataExplorer` is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
20+
21+
Both `RunAsPreviewEmulator` and `WithDataExplorer` are considered experimental APIs.
22+
23+
.NET Aspire provides a way to use the Cosmos DB Linux-based (preview) emulator and data explorer. These APIs are considered experimental and are expected to change in the future.
24+
25+
## Example
26+
27+
The following sample generates `ASPIRECOSMOSDB001`:
28+
29+
```csharp
30+
var builder = DistributedApplication.CreateBuilder(args);
31+
32+
var cosmos = builder.AddAzureCosmosDB("cosmos")
33+
.RunAsPreviewEmulator(e => e.WithDataExplorer());
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.ASPIRECOSMOSDB001.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);ASPIRECOSMOSDB001</NoWarn>
54+
</PropertyGroup>
55+
```
56+
57+
- Suppress in code with the `#pragma warning disable ASPIRECOSMOSDB001` directive.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Compiler Error ASPIREHOSTINGPYTHON001
3+
description: Learn more about compiler Error ASPIREHOSTINGPYTHON001. `AddPythonApp` is for evaluation purposes only and is subject to change or removal in future updates.
4+
ms.date: 04/21/2025
5+
f1_keywords:
6+
- "ASPIREHOSTINGPYTHON001"
7+
helpviewer_keywords:
8+
- "ASPIREHOSTINGPYTHON001"
9+
---
10+
11+
# Compiler Error ASPIREHOSTINGPYTHON001
12+
13+
**Version introduced:** 9.0
14+
15+
> `AddPythonApp` is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
16+
17+
.NET Aspire provides a way to add Python executables or applications to the .NET Aspire app host with the `AddPythonApp` extension. Since the shape of this API is expected to change in the future, it's experimental.
18+
19+
## Example
20+
21+
The following code generates `ASPIREHOSTINGPYTHON001`:
22+
23+
```csharp
24+
var pythonApp = builder.AddPythonApp("hello-python", "../hello-python", "main.py")
25+
.WithHttpEndpoint(env: "PORT")
26+
.WithExternalHttpEndpoints()
27+
.WithOtlpExporter();
28+
```
29+
30+
## To correct this Error
31+
32+
Suppress the Error with either of the following methods:
33+
34+
- Set the severity of the rule in the _.editorConfig_ file.
35+
36+
```ini
37+
[*.{cs,vb}]
38+
dotnet_diagnostic.ASPIREHOSTINGPYTHON001.severity = none
39+
```
40+
41+
For more information about editor config files, see [Configuration files for code analysis rules](/dotnet/fundamentals/code-analysis/configuration-files).
42+
43+
- Add the following `PropertyGroup` to your project file:
44+
45+
```xml
46+
<PropertyGroup>
47+
<NoWarn>$(NoWarn);ASPIREHOSTINGPYTHON001</NoWarn>
48+
</PropertyGroup>
49+
```
50+
51+
- Suppress in code with the `#pragma warning disable ASPIREHOSTINGPYTHON001` directive.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Compiler Error ASPIREPUBLISHERS001
3+
description: Learn more about compiler Error ASPIREPUBLISHERS001. Publishers are for evaluation purposes only and are subject to change or removal in future updates.
4+
ms.date: 04/21/2025
5+
f1_keywords:
6+
- "ASPIREPUBLISHERS001"
7+
helpviewer_keywords:
8+
- "ASPIREPUBLISHERS001"
9+
---
10+
11+
# Compiler Error ASPIREPUBLISHERS001
12+
13+
**Version introduced:** 9.2
14+
15+
> Publishers are for evaluation purposes only and are subject to change or removal in future updates. Suppress this diagnostic to proceed.
16+
17+
.NET Aspire introduced the concept of _Publishers_ starting in version 9.2. Publishers play a pivotal role in the deployment process, enabling the transformation of your distributed app into deployable assets. This alleviates the intermediate step of producing the publishing [manifest](../deployment/manifest-format.md) for tools to act on, instead empowering the developer to express their intent directly in C#.
18+
19+
Publishers are considered experimental and are expected to change in the future.
20+
21+
## To correct this Error
22+
23+
Suppress the Error with either of the following methods:
24+
25+
- Set the severity of the rule in the _.editorConfig_ file.
26+
27+
```ini
28+
[*.{cs,vb}]
29+
dotnet_diagnostic.ASPIREPUBLISHERS001.severity = none
30+
```
31+
32+
For more information about editor config files, see [Configuration files for code analysis rules](/dotnet/fundamentals/code-analysis/configuration-files).
33+
34+
- Add the following `PropertyGroup` to your project file:
35+
36+
```xml
37+
<PropertyGroup>
38+
<NoWarn>$(NoWarn);ASPIREPUBLISHERS001</NoWarn>
39+
</PropertyGroup>
40+
```
41+
42+
- Suppress in code with the `#pragma warning disable ASPIREPUBLISHERS001` directive.

0 commit comments

Comments
 (0)