Skip to content
Docs Try Aspire

Compiler Warning ASPIREPOSTGRES001

Version introduced: 9.3

The PostgreSQL MCP integration APIs are experimental and subject to change or removal in future updates. Suppress this diagnostic to proceed.

The WithPostgresMcp extension method for adding Model Context Protocol (MCP) support to PostgreSQL resources is an experimental feature. This API may change or be removed in future versions.

The following code generates ASPIREPOSTGRES001:

C# — AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var db = builder.AddAzurePostgresFlexibleServer("postgres")
.AddDatabase("mydb")
.WithPostgresMcp();

Suppress the warning with either of the following methods:

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

    .editorconfig
    [*.{cs,vb}]
    dotnet_diagnostic.ASPIREPOSTGRES001.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);ASPIREPOSTGRES001</NoWarn>
    </PropertyGroup>
  • Suppress in code with the #pragma warning disable ASPIREPOSTGRES001 directive:

    C# — Suppressing the warning
    #pragma warning disable ASPIREPOSTGRES001
    var db = builder.AddAzurePostgresFlexibleServer("postgres")
    .AddDatabase("mydb")
    .WithPostgresMcp();
    #pragma warning restore ASPIREPOSTGRES001