Aspire.Hosting.Integration.Analyzers
13.6.4-preview.1.26523.11
Prefix Reserved
dotnet add package Aspire.Hosting.Integration.Analyzers --version 13.6.4-preview.1.26523.11
NuGet\Install-Package Aspire.Hosting.Integration.Analyzers -Version 13.6.4-preview.1.26523.11
<PackageReference Include="Aspire.Hosting.Integration.Analyzers" Version="13.6.4-preview.1.26523.11"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Aspire.Hosting.Integration.Analyzers" Version="13.6.4-preview.1.26523.11" />
<PackageReference Include="Aspire.Hosting.Integration.Analyzers"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Aspire.Hosting.Integration.Analyzers --version 13.6.4-preview.1.26523.11
#r "nuget: Aspire.Hosting.Integration.Analyzers, 13.6.4-preview.1.26523.11"
#:package Aspire.Hosting.Integration.Analyzers@13.6.4-preview.1.26523.11
#addin nuget:?package=Aspire.Hosting.Integration.Analyzers&version=13.6.4-preview.1.26523.11&prerelease
#tool nuget:?package=Aspire.Hosting.Integration.Analyzers&version=13.6.4-preview.1.26523.11&prerelease
Aspire.Hosting.Integration.Analyzers package
Provides Roslyn analyzers for Aspire hosting integration authors building ATS and polyglot-friendly extensions outside the Aspire repo.
Getting started
Install the package
In your integration project, install the analyzer package with NuGet:
dotnet add package Aspire.Hosting.Integration.Analyzers --prerelease
If you edit the project file directly, keep the analyzer private and use the same package version as the Aspire packages referenced by the integration:
<ItemGroup>
<PackageReference Include="Aspire.Hosting.Integration.Analyzers" Version="<Aspire package version>" PrivateAssets="all" />
</ItemGroup>
Usage
The package is applied automatically when it is referenced. No additional MSBuild property is required.
Integrations that run these analyzers are treated as polyglot-compatible by default and automatically get the polyglot NuGet tag so aspire add can surface the integration to non-C# (TypeScript, Python, Go, Java, Rust) AppHosts. A project that is not a polyglot integration (for example, infrastructure that has no [AspireExport] surface) must acknowledge that by setting the following property:
<PropertyGroup>
<IsAspirePolyglotCompatible>false</IsAspirePolyglotCompatible>
</PropertyGroup>
Setting the property to false omits the polyglot NuGet tag. If a project has no [AspireExport] coverage and does not opt out, the build fails with ASPIREEXPORT017, prompting you to either add export coverage or opt out.
The analyzers validate common ATS export patterns used by polyglot integrations, such as:
- exported builder methods that directly invoke synchronous callbacks
- unsupported signatures or exported shapes for ATS/code-generated hosting surfaces
- other authoring patterns that can break polyglot consumers
For example, this pattern produces analyzer feedback because the exported API executes a synchronous callback directly:
using Aspire.Hosting;
using Aspire.Hosting.ApplicationModel;
namespace MyIntegration;
public static class MyIntegrationExtensions
{
[AspireExport("addMyContainer")]
public static IResourceBuilder<ContainerResource> AddMyContainer(
this IDistributedApplicationBuilder builder,
string name,
Action<IResourceBuilder<ContainerResource>> configure)
{
var resource = builder.AddContainer(name, "my-image");
configure(resource);
return resource;
}
}
Additional documentation
- https://aspire.dev/extensibility/multi-language-integration-authoring/#install-the-analyzer
- https://github.com/microsoft/aspire/blob/main/src/Aspire.Hosting/Ats/ThirdPartyAtsAttributes.md
- https://github.com/microsoft/aspire/blob/main/docs/specs/polyglot-apphost.md
Feedback & contributing
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 13.6.4-preview.1.26523.11 | 55 | 10/24/2026 |
| 13.6.3-preview.1.26521.2 | 53 | 10/21/2026 |
| 13.6.2-preview.1.26519.11 | 52 | 10/20/2026 |
| 13.6.1-preview.1.26506.6 | 97 | 10/7/2026 |
| 13.6.0-preview.1.26479.8 | 77 | 9/29/2026 |
| 13.5.4-preview.1.26464.4 | 89 | 9/15/2026 |
| 13.5.3-preview.1.26425.3 | 104 | 8/25/2026 |
| 13.5.2-preview.1.26421.6 | 102 | 8/21/2026 |
| 13.5.1-preview.1.26420.4 | 97 | 8/20/2026 |
| 13.5.0-preview.1.26417.10 | 966 | 8/18/2026 |
| 13.4.6-preview.1.26319.6 | 457 | 6/19/2026 |
| 13.4.5-preview.1.26316.12 | 93 | 6/17/2026 |
| 13.4.4-preview.1.26314.3 | 83 | 6/15/2026 |
| 13.4.3-preview.1.26305.13 | 2,347 | 6/8/2026 |
| 13.4.2-preview.1.26303.6 | 175 | 6/3/2026 |
| 13.4.1-preview.1.26303.3 | 83 | 6/3/2026 |
| 13.4.0-preview.1.26281.18 | 891 | 6/1/2026 |