-
Notifications
You must be signed in to change notification settings - Fork 78
Update ASPIRE008 diagnostic page for GenerateAssemblyInfo requirement #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
IEvangelist
merged 3 commits into
release/13.2
from
copilot/add-page-for-aspire008-code
Jan 26, 2026
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,65 +1,75 @@ | ||
| --- | ||
| title: Compiler Error ASPIRE008 | ||
| description: Learn more about compiler Error ASPIRE008. The installed Aspire workload is deprecated. It is recommended to migrate to the new format. | ||
| description: Learn more about compiler Error ASPIRE008. The project requires GenerateAssemblyInfo to be enabled for the AppHost to function correctly. | ||
| --- | ||
|
|
||
| import { Aside, Badge, Steps } from '@astrojs/starlight/components'; | ||
| import { Aside, Badge } from '@astrojs/starlight/components'; | ||
|
|
||
| <Badge text="Version introduced: 8.2.3" variant='note' size='large' class:list={'mb-1'} /> | ||
| <Badge text="Version introduced: 9.2.0" variant='note' size='large' class:list={'mb-1'} /> | ||
|
|
||
| > The Aspire workload that this project depends on is now deprecated. | ||
| > '[ProjectName]' project requires GenerateAssemblyInfo to be enabled. The Aspire AppHost relies on assembly metadata attributes to locate required dependencies. | ||
|
|
||
| This error appears when a project uses a version of Aspire that relies on the SDK workload, which is now deprecated. The error guides you to migrate your project to a supported version of Aspire that uses the SDK approach instead of the workload. | ||
| This error appears when an Aspire AppHost project has `GenerateAssemblyInfo` set to `false`. The Aspire AppHost relies on `AssemblyMetadataAttribute` to embed DCP (Developer Control Plane) and Dashboard paths during compilation. When `GenerateAssemblyInfo` is disabled, these attributes aren't generated, causing runtime failures about missing orchestration dependencies. | ||
|
|
||
| ## Example | ||
|
|
||
| The following AppHost project file uses the deprecated Aspire workload: | ||
| The following AppHost project file has `GenerateAssemblyInfo` disabled, which causes `ASPIRE008`: | ||
|
|
||
| ```xml title="C# project file" | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <Sdk Name="Aspire.AppHost.Sdk" Version="9.2.0" /> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <TargetFramework>net9.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| <IsAspireHost>true</IsAspireHost> | ||
| <UserSecretsId>98048c9c-bf28-46ba-a98e-63767ee5e3a8</UserSecretsId> | ||
| <GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Aspire.Hosting.AppHost" Version="8.2.2" /> | ||
| <PackageReference Include="Aspire.Hosting.AppHost" Version="9.2.0" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> | ||
| ``` | ||
|
|
||
| For more information on the Aspire SDK, see [Aspire SDK](https://learn.microsoft.com/dotnet/aspire/fundamentals/dotnet-aspire-sdk/). | ||
|
|
||
| ## To correct this error | ||
|
|
||
| Follow the migration guide at [https://aka.ms/aspire/update-to-sdk](https://aka.ms/aspire/update-to-sdk) to upgrade your project to a supported version of Aspire that uses the SDK approach. | ||
| Remove the `<GenerateAssemblyInfo>false</GenerateAssemblyInfo>` line from your project file, or set it to `true`: | ||
|
|
||
| The migration typically involves: | ||
| ```xml title="C# project file" | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here: <Project Sdk="Aspire.AppHost.Sdk/13.1.0">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UserSecretsId>98048c9c-bf28-46ba-a98e-63767ee5e3a8</UserSecretsId>
</PropertyGroup>
</Project>
xml
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated this sample as well in commit 2dcc31e. |
||
|
|
||
| <Steps> | ||
| <Sdk Name="Aspire.AppHost.Sdk" Version="9.2.0" /> | ||
|
|
||
| 1. Updating your AppHost project file to use the `Aspire.AppHost.Sdk`. | ||
| 1. Removing references to the deprecated workload. | ||
| 1. Updating package references to supported versions. | ||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net9.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| <IsAspireHost>true</IsAspireHost> | ||
| </PropertyGroup> | ||
|
|
||
| </Steps> | ||
| <ItemGroup> | ||
| <PackageReference Include="Aspire.Hosting.AppHost" Version="9.2.0" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> | ||
| ``` | ||
|
|
||
| ## Suppress the error | ||
|
|
||
| <Aside type="danger"> | ||
| Suppressing this error isn't recommended, as it leaves your project depending on an unsupported version of Aspire. | ||
| Suppressing this error isn't recommended, as it will cause runtime failures when the AppHost attempts to locate orchestration dependencies. | ||
| </Aside> | ||
|
|
||
| If you need to temporarily suppress this error, add the following property to your project file: | ||
| If you must temporarily suppress this error, add the following property to your project file: | ||
|
|
||
| ```xml title="C# project file" | ||
| <PropertyGroup> | ||
| <SuppressAspireWorkloadDeprecationError>true</SuppressAspireWorkloadDeprecationError> | ||
| <NoWarn>$(NoWarn);ASPIRE008</NoWarn> | ||
| </PropertyGroup> | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we update this project file sample to match the modern form for 13.x projects? i.e.:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the project file sample to use the modern 13.x format with
Aspire.AppHost.Sdk/13.1.0,net10.0, andUserSecretsIdin commit 2dcc31e.