İçeriğe geç
Docs Try Aspire
Docs Try

Compiler Error ASPIREBROWSERLOGS001

Bu içerik henüz dilinizde mevcut değil.

Version introduced: 13.3

Browser logs types and members are for evaluation purposes only and are subject to change or removal in future updates. Suppress this diagnostic to proceed.

This diagnostic error is reported when using experimental browser logs APIs in Aspire from the Aspire.Hosting.Browsers package, including:

  • WithBrowserLogs extension method
  • BrowserUserDataMode enum
  • Other types and members that configure the tracked browser session

These APIs let you attach a tracked Chromium browser session to any HTTP/HTTPS resource in your AppHost so that browser console output flows into the resource’s console log stream in the Aspire dashboard. For more information, see Browser logs.

The following code generates ASPIREBROWSERLOGS001:

C# — AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
builder.AddViteApp("web", "../web")
.WithBrowserLogs();
builder.Build().Run();

Suppress the error with either of the following methods:

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

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

    C# — Suppressing the error
    #pragma warning disable ASPIREBROWSERLOGS001
    var builder = DistributedApplication.CreateBuilder(args);
    builder.AddViteApp("web", "../web")
    .WithBrowserLogs();
    builder.Build().Run();