Zum Inhalt springen

Compiler Error ASPIREHOSTINGPYTHON001

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Version introduced: 9.0

AddPythonApp is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

Aspire provides a way to add Python executables or applications to the Aspire AppHost with the AddPythonApp extension. Since the shape of this API is expected to change in the future, it’s experimental.

The following code generates ASPIREHOSTINGPYTHON001:

C# — AppHost.cs
var pythonApp = builder.AddPythonApp("hello-python", "../hello-python", "main.py")
.WithHttpEndpoint(env: "PORT")
.WithExternalHttpEndpoints()
.WithOtlpExporter();

Suppress the error with either of the following methods:

  • Set the severity of the rule in the .editorconfig file.

    .editorconfig
    [*.{cs,vb}]
    dotnet_diagnostic.ASPIREHOSTINGPYTHON001.severity = none

    For more information about editor config files, see Configuration files for code analysis rules.

  • Add the following PropertyGroup to your project file:

    C# project file
    <PropertyGroup>
    <NoWarn>$(NoWarn);ASPIREHOSTINGPYTHON001</NoWarn>
    </PropertyGroup>
  • Suppress in code with the #pragma warning disable ASPIREHOSTINGPYTHON001 directive.

Fragen & AntwortenZusammenarbeitenCommunityDiskutierenAnsehen