From fc9a5e4edcea44f5a57a58d05545bf9e3e412e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Ros?= Date: Tue, 22 Oct 2024 15:31:50 -0700 Subject: [PATCH 1/3] Document experimental attributes for Aspire.hosting.Python --- docs/diagnostics/overview.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/diagnostics/overview.md b/docs/diagnostics/overview.md index 0ac0d94527..d107b90275 100644 --- a/docs/diagnostics/overview.md +++ b/docs/diagnostics/overview.md @@ -48,3 +48,23 @@ Alternatively, you can suppress this diagnostic with preprocessor directive by a // API that is causing the warning. #pragma warning restore ASPIREACADOMAINS001 ``` + +## ASPIREHOSTINGPYTHON001 + +.NET Aspire provides a way to add Python executables or applications to the .NET Aspire app host. Since the shape of this API is expected to change in the future, it has been marked as _Experimental_. To suppress the compiler error/warning use the following code: + +To suppress this diagnostic with the `SuppressMessageAttribute`, add the following code to your project: + +```csharp +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("ASPIREHOSTINGPYTHON001", "Justification")] +``` + +Alternatively, you can suppress this diagnostic with preprocessor directive by adding the following code to your project: + +```csharp +#pragma warning disable ASPIREHOSTINGPYTHON001 + // API that is causing the warning. +#pragma warning restore ASPIREHOSTINGPYTHON001 +``` From fb4dda4c4c53ccd67666f310fc8ccd2401a5131e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Ros?= Date: Wed, 23 Oct 2024 08:06:05 -0700 Subject: [PATCH 2/3] Use NoWarn instead of SuppressMessage --- docs/diagnostics/overview.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/diagnostics/overview.md b/docs/diagnostics/overview.md index d107b90275..0d514c7dff 100644 --- a/docs/diagnostics/overview.md +++ b/docs/diagnostics/overview.md @@ -13,12 +13,12 @@ Several APIs of .NET Aspire are decorated with the + $(NoWarn);ASPIREHOSTINGPYTHON001 + ``` Alternatively, you can suppress this diagnostic with preprocessor directive by adding the following code to your project: From 2e3d821bd5fd9a3f460e9e559d5b00aae1538e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Ros?= Date: Wed, 23 Oct 2024 08:26:44 -0700 Subject: [PATCH 3/3] changed wrong diagnostics --- docs/diagnostics/overview.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/diagnostics/overview.md b/docs/diagnostics/overview.md index 0d514c7dff..f0c88caacd 100644 --- a/docs/diagnostics/overview.md +++ b/docs/diagnostics/overview.md @@ -13,12 +13,12 @@ Several APIs of .NET Aspire are decorated with the - $(NoWarn);ASPIREHOSTINGPYTHON001 - +```csharp +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("AZPROVISION001", "Justification")] ``` Alternatively, you can suppress this diagnostic with preprocessor directive by adding the following code to your project: @@ -53,12 +53,12 @@ Alternatively, you can suppress this diagnostic with preprocessor directive by a .NET Aspire provides a way to add Python executables or applications to the .NET Aspire app host. Since the shape of this API is expected to change in the future, it has been marked as _Experimental_. To suppress the compiler error/warning use the following code: -To suppress this diagnostic with the `SuppressMessageAttribute`, add the following code to your project: - -```csharp -using System.Diagnostics.CodeAnalysis; +To suppress this diagnostic with the `SuppressMessageAttribute`, add the following code to your project file: -[assembly: SuppressMessage("ASPIREHOSTINGPYTHON001", "Justification")] +```xml + + $(NoWarn);ASPIREHOSTINGPYTHON001 + ``` Alternatively, you can suppress this diagnostic with preprocessor directive by adding the following code to your project: