Compiler Warning ASPIREATS001
ATS (Aspire Type Specification) types 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 the experimental Aspire Type Specification (ATS) types and related APIs. These types enable polyglot AppHost support by defining runtime execution configurations for different languages.
The following types are protected by this diagnostic:
RuntimeSpec— specifies the runtime execution configuration for a language.CommandSpec— specifies a command to execute.AtsCapabilityInfo— capability information for ATS.AtsConstants— constants used by ATS.AtsContext— context for ATS operations.ICodeGenerator— interface for code generation.ILanguageSupport— interface for language support.
Example
Section titled “Example”The following code generates ASPIREATS001:
var spec = new RuntimeSpec{ Language = "TypeScript", DisplayName = "TypeScript (Node.js)", CodeGenLanguage = "typescript", DetectionPatterns = ["apphost.ts"], Execute = new CommandSpec { Command = "npx", Args = ["tsx", "{appHostFile}", "{args}"] }};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.ASPIREATS001.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);ASPIREATS001</NoWarn></PropertyGroup> -
Suppress in code with the
#pragma warning disable ASPIREATS001directive:C# — Suppressing the warning #pragma warning disable ASPIREATS001var spec = new RuntimeSpec{Language = "TypeScript",DisplayName = "TypeScript (Node.js)",CodeGenLanguage = "typescript",DetectionPatterns = ["apphost.ts"],Execute = new CommandSpec{Command = "npx",Args = ["tsx", "{appHostFile}", "{args}"]}};#pragma warning restore ASPIREATS001