Compiler Error ASPIREBROWSERLOGS001
이 콘텐츠는 아직 번역되지 않았습니다.
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:
WithBrowserLogsextension methodBrowserUserDataModeenum- 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.
Example
Section titled “Example”The following code generates ASPIREBROWSERLOGS001:
var builder = DistributedApplication.CreateBuilder(args);
builder.AddViteApp("web", "../web") .WithBrowserLogs();
builder.Build().Run();To correct this error
Section titled “To correct this error”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 = noneFor more information about editor config files, see Configuration files for code analysis rules.
-
Add the following
PropertyGroupto your project file:C# project file <PropertyGroup><NoWarn>$(NoWarn);ASPIREBROWSERLOGS001</NoWarn></PropertyGroup> -
Suppress in code with the
#pragma warning disable ASPIREBROWSERLOGS001directive:C# — Suppressing the error #pragma warning disable ASPIREBROWSERLOGS001var builder = DistributedApplication.CreateBuilder(args);builder.AddViteApp("web", "../web").WithBrowserLogs();builder.Build().Run();