Obsolete ParameterResource.Value property with suppressions for migration #10698
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.
This PR marks the
ParameterResource.Valueproperty as obsolete to prepare for migration to the asyncGetValueAsyncmethod. This is the first phase of the migration strategy where we identify all usages and suppress the obsolete warnings to maintain a working build state.Changes Made
Core Change
ParameterResource.Valueproperty as[Obsolete]with updated XML documentation recommending migration toGetValueAsyncor directParameterResourceusageerror: true) since error-level obsolete attributes cannot be suppressed with pragma directivesSuppressions Added
Added
#pragma warning disable CS0618suppressions in the following files:src/Aspire.Hosting.Docker/DockerComposeServiceExtensions.cs- Parameter default value handlingsrc/Aspire.Hosting.Kubernetes/KubernetesServiceResourceExtensions.cs- Helm value resolutiontests/Aspire.Hosting.Tests/AddParameterTests.cs- Multiple test assertionstests/Aspire.Hosting.Tests/Orchestrator/ParameterProcessorTests.cs- Parameter processor validationtests/Aspire.Hosting.Tests/DistributedApplicationTests.cs- Redis connection string testsSpecial Case
src/Aspire.Hosting.Azure/AzurePublishingContext.cs- Used project-level<NoWarn>CS0618</NoWarn>suppression due to refactored helper method approachMigration Strategy
This PR represents Phase 1 of the migration:
The suppressions ensure the build continues to work while we plan the migration strategy for each usage. Some usages may be appropriate for
GetValueAsyncmigration, while others might need different approaches.Testing
All individual projects build successfully with the obsolete warnings properly suppressed. The functionality remains unchanged - this is purely a preparatory step for the async migration.
Fixes #10362
Related to #10354, #10359, #10361
This pull request was created as a result of the following prompt from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.