Compiler Warning ASPIREPIPELINES004
Pipeline output service 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 warning is reported when using the experimental IPipelineOutputService interface and the PipelineOutputService implementation. These APIs are part of the Aspire pipeline infrastructure for managing output and temporary directories during deployment operations.
The IPipelineOutputService interface provides directory management functionality for Aspire deployment pipelines:
- Output directories: Manages the location where deployment artifacts are written
- Temporary directories: Provides isolated temporary storage for build operations
- Resource-specific paths: Creates subdirectories for individual resources
This API is experimental because the pipeline infrastructure is under active development, and the directory management strategy may evolve based on deployment scenario requirements.
Example
Section titled “Example”The following code generates ASPIREPIPELINES004:
var builder = DistributedApplication.CreateBuilder(args);
// Using IPipelineOutputServicevar outputService = builder.Services.BuildServiceProvider().GetRequiredService<IPipelineOutputService>();var outputDir = outputService.GetOutputDirectory();var tempDir = outputService.GetTempDirectory();Related types
Section titled “Related types”IPipelineOutputService: Service for managing pipeline output and temporary directoriesPipelineOutputService: Default implementation managing configured and default pathsGetOutputDirectory(): Gets the base output directory for deployment artifactsGetOutputDirectory(IResource): Gets a resource-specific output subdirectoryGetTempDirectory(): Gets the base temporary directory for build artifactsGetTempDirectory(IResource): Gets a resource-specific temporary subdirectory
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.ASPIREPIPELINES004.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);ASPIREPIPELINES004</NoWarn></PropertyGroup> -
Suppress in code with the
#pragma warning disable ASPIREPIPELINES004directive:C# — Suppressing the warning #pragma warning disable ASPIREPIPELINES004var outputService = builder.Services.BuildServiceProvider().GetRequiredService<IPipelineOutputService>();var outputDir = outputService.GetOutputDirectory();#pragma warning restore ASPIREPIPELINES004