Gå til indhold
Docs Try Aspire
Docs Try

Compiler Warning ASPIREJAVASCRIPT001

Dette indhold er ikke tilgængeligt i dit sprog endnu.

Version introduced: 13.3

JavaScript hosting APIs are for evaluation purposes only and are subject to change or removal in future updates. Suppress this diagnostic to proceed.

This diagnostic warning is reported when using experimental JavaScript hosting and publishing APIs in Aspire, including:

  • PublishAsStaticWebsite<TResource>
  • PublishAsNodeServer<TResource>
  • PublishAsNpmScript<TResource>
  • AddNextJsApp
  • DisableBuildValidation

These APIs enable you to configure how JavaScript applications (Vite, Node.js, Next.js) are published and deployed via Aspire’s pipeline infrastructure.

The following code generates ASPIREJAVASCRIPT001:

C# — AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var frontend = builder.AddViteApp("frontend", "../MyViteApp")
.PublishAsStaticWebsite();

Suppress the warning with either of the following methods:

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

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