diff --git a/src/frontend/config/sidebar/reference.topics.ts b/src/frontend/config/sidebar/reference.topics.ts index bc05f97d8..be47e1a42 100644 --- a/src/frontend/config/sidebar/reference.topics.ts +++ b/src/frontend/config/sidebar/reference.topics.ts @@ -698,6 +698,10 @@ export const referenceTopics: StarlightSidebarTopicsUserConfig[number] = { label: 'ASPIREPROCESSCOMMAND001', link: '/diagnostics/aspireprocesscommand001', }, + { + label: 'ASPIREPROJECTS001', + link: '/diagnostics/aspireprojects001', + }, { label: 'ASPIREUSERSECRETS001', link: '/diagnostics/aspireusersecrets001', diff --git a/src/frontend/src/content/docs/diagnostics/aspireextension001.mdx b/src/frontend/src/content/docs/diagnostics/aspireextension001.mdx index f2e16b244..b34745ecf 100644 --- a/src/frontend/src/content/docs/diagnostics/aspireextension001.mdx +++ b/src/frontend/src/content/docs/diagnostics/aspireextension001.mdx @@ -19,6 +19,8 @@ This diagnostic warning is reported when using experimental extension debugging - `WithDebugSupport` extension method - `SupportsDebuggingAnnotation` +- `DebugSupportExtensions.SupportsDebugging` and `DebugSupportExtensions.CreateLaunchConfigurationAsync` +- `ExecutableLaunchConfiguration`, `ProjectLaunchConfiguration`, `ExecutableLaunchMode`, and `KnownLaunchConfigurationTypes` - `WithLaunchToolArgs` extension method These APIs are primarily used by integration authors to enable F5 debugging for custom resource types in Visual Studio and other IDEs. diff --git a/src/frontend/src/content/docs/diagnostics/aspireprojects001.mdx b/src/frontend/src/content/docs/diagnostics/aspireprojects001.mdx new file mode 100644 index 000000000..c0552d53c --- /dev/null +++ b/src/frontend/src/content/docs/diagnostics/aspireprojects001.mdx @@ -0,0 +1,62 @@ +--- +title: Compiler Warning ASPIREPROJECTS001 +seoTitle: "ASPIREPROJECTS001: Project launch defaults APIs are for" +description: Learn what causes the Aspire compiler warning ASPIREPROJECTS001 and how to fix it so your AppHost builds cleanly. +--- + +import { Badge } from '@astrojs/starlight/components'; + + + +> Project launch defaults 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 experimental project launch defaults APIs in Aspire, including: + +- `WithProjectDefaults` extension method +- `ProjectLaunchDefaultsAnnotation` +- `ProjectLaunchArgsOverrideAnnotation` + +These APIs let a resource opt into the same launch-profile, Kestrel endpoint, and `ASPNETCORE_URLS` wiring that Aspire applies to `AddProject` resources. The resource must carry `IProjectMetadata`. They exist primarily so language integration packages (such as `Aspire.Hosting.Dotnet`) can reuse this behavior for resources that are launched through the .NET SDK. + +## Example + +The following code generates `ASPIREPROJECTS001`: + +```csharp title="AppHost.cs" +var builder = DistributedApplication.CreateBuilder(args); +var options = new ProjectResourceOptions(); + +builder.AddResource(new MyDotnetResource("resource")) + .WithProjectDefaults(options); +``` + +## To correct this warning + +Suppress the warning with either of the following methods: + +- Set the severity of the rule in the _.editorconfig_ file. + + ```ini title=".editorconfig" + [*.{cs,vb}] + dotnet_diagnostic.ASPIREPROJECTS001.severity = none + ``` + + For more information about editor config files, see [Configuration files for code analysis rules](/diagnostics/overview/#suppress-in-the-editorconfig-file). + +- Add the following `PropertyGroup` to your project file: + + ```xml title="C# project file" + + $(NoWarn);ASPIREPROJECTS001 + + ``` + +## See also + +- [ASPIREEXTENSION001](/diagnostics/aspireextension001/) - Related experimental debug support APIs +- [Custom hosting integrations](/integrations/custom-integrations/hosting-integrations/) - Learn about creating custom integrations diff --git a/src/frontend/src/content/docs/diagnostics/overview.mdx b/src/frontend/src/content/docs/diagnostics/overview.mdx index f22708a22..1a5bf2e2d 100644 --- a/src/frontend/src/content/docs/diagnostics/overview.mdx +++ b/src/frontend/src/content/docs/diagnostics/overview.mdx @@ -56,6 +56,7 @@ The following table lists the possible MSBuild and analyzer warnings and errors | [ASPIREPOSTGRES001](/diagnostics/aspirepostgres001/) | (Experimental) Warning | PostgreSQL MCP integration is for evaluation purposes only and is subject to change or removal in future updates. | | [ASPIREPROBES001](/diagnostics/aspireprobes001/) | (Experimental) Warning | Probe-related types and members are for evaluation purposes only and are subject to change or removal in future updates. | | [ASPIREPROCESSCOMMAND001](/diagnostics/aspireprocesscommand001/) | (Experimental) Warning | Process command types and members are for evaluation purposes only and are subject to change or removal in future updates. | +| [ASPIREPROJECTS001](/diagnostics/aspireprojects001/) | (Experimental) Warning | Project launch defaults types and members are for evaluation purposes only and are subject to change or removal in future updates. | | [ASPIREPROXYENDPOINTS001](/diagnostics/aspireproxyendpoints001/) | (Experimental) Error | ProxyEndpoint members are for evaluation purposes only and are subject to change or removal in future updates. | | [ASPIREPUBLISHERS001](/diagnostics/aspirepublishers001/) | Error | Publishers are for evaluation purposes only and are subject to change or removal in future updates. | | [ASPIREUSERSECRETS001](/diagnostics/aspireusersecrets001/) | (Experimental) Warning | Type is for evaluation purposes only and is subject to change or removal in future updates. |