diff --git a/src/frontend/src/content/docs/extensibility/multi-language-integration-authoring.mdx b/src/frontend/src/content/docs/extensibility/multi-language-integration-authoring.mdx index c72eb5019..243da37e0 100644 --- a/src/frontend/src/content/docs/extensibility/multi-language-integration-authoring.mdx +++ b/src/frontend/src/content/docs/extensibility/multi-language-integration-authoring.mdx @@ -4,12 +4,7 @@ seoTitle: Author multi-language Aspire integrations for AppHost description: Annotate Aspire hosting integrations so they work with TypeScript AppHosts and the generated SDK, while preparing exports for future AppHost languages. --- -import { - Aside, - Steps, - Tabs, - TabItem, -} from '@astrojs/starlight/components'; +import { Aside, Steps } from '@astrojs/starlight/components'; Aspire hosting integrations are C# libraries that extend the AppHost with new resource types. By default, these integrations are only available in C# AppHosts. To make them available in TypeScript AppHosts, you annotate your APIs with ATS (Aspire Type System) attributes. @@ -34,7 +29,10 @@ Your C# code runs as-is — the TypeScript SDK is a thin client that calls into ## Enable the analyzer -The integration analyzer provides build-time validation that catches common export mistakes. It ships **inside the [`📦 Aspire.Hosting`](https://www.nuget.org/packages/Aspire.Hosting) package** — you don't install a separate analyzer package. Because hosting integrations already reference `Aspire.Hosting`, all you need to do is opt in to the analyzer by setting the `EnableAspireIntegrationAnalyzers` MSBuild property in your integration project: +The integration analyzer provides build-time validation that catches common export mistakes. Use either supported enablement path: + +- If your integration already references [`📦 Aspire.Hosting`](https://www.nuget.org/packages/Aspire.Hosting), opt in by setting the `EnableAspireIntegrationAnalyzers` MSBuild property in your integration project. +- Alternatively, reference the standalone [`📦 Aspire.Hosting.Integration.Analyzers`](https://www.nuget.org/packages/Aspire.Hosting.Integration.Analyzers) package with `PrivateAssets="all"` using the same Aspire package version. The standalone analyzer package applies automatically and doesn't require the MSBuild property. ```xml title="XML — MyIntegration.csproj" @@ -54,7 +52,7 @@ Annotate your extension methods with `[AspireExport]` and use XML doc comments t /// The MyDatabase resource name. /// The optional port. /// The MyDatabase resource builder. -[AspireExport("addMyDatabase")] +[AspireExport] public static IResourceBuilder AddMyDatabase( this IDistributedApplicationBuilder builder, [ResourceName] string name, @@ -68,7 +66,7 @@ public static IResourceBuilder AddMyDatabase( /// The database name. /// The optional database name override. /// The database resource builder. -[AspireExport("addDatabase")] +[AspireExport] public static IResourceBuilder AddDatabase( this IResourceBuilder builder, [ResourceName] string name, @@ -81,7 +79,7 @@ public static IResourceBuilder AddDatabase( /// The MyDatabase server resource builder. /// The optional volume name. /// The MyDatabase resource builder. -[AspireExport("withDataVolume")] +[AspireExport] public static IResourceBuilder WithDataVolume( this IResourceBuilder builder, string? name = null) @@ -102,13 +100,14 @@ const db = await builder .addDatabase('mydata') .withDataVolume(); -const app = await builder.build(); -await app.run(); +await builder.build().run(); ```