Compiler Warning ASPIREJAVASCRIPT001
Это содержимое пока не доступно на вашем языке.
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>AddNextJsAppDisableBuildValidation
These APIs enable you to configure how JavaScript applications (Vite, Node.js, Next.js) are published and deployed via Aspire’s pipeline infrastructure.
Example
Section titled “Example”The following code generates ASPIREJAVASCRIPT001:
var builder = DistributedApplication.CreateBuilder(args);
var frontend = builder.AddViteApp("frontend", "../MyViteApp") .PublishAsStaticWebsite();To correct this warning
Section titled “To correct this warning”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 = 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);ASPIREJAVASCRIPT001</NoWarn></PropertyGroup> -
Suppress in code with the
#pragma warning disable ASPIREJAVASCRIPT001directive.
See also
Section titled “See also”- Deploy JavaScript apps - Learn about deploying JavaScript applications with Aspire