[release/10.0] Add UrlFormat to ObsoleteAttribute for ASPDEPR diagnostics #64018
+81
−25
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.
Backport of #63909 to release/10.0
/cc @joperezr @copilot
Add UrlFormat to ObsoleteAttribute for ASPDEPR diagnostics
Fix broken documentation links in Visual Studio for deprecated ASP.NET Core APIs
Description
Updated all ASPDEPR obsoletions to use specific URL constants that point to the correct aka.ms documentation links with numeric diagnostic IDs. This ensures that when developers see these deprecation warnings in Visual Studio, the URLs will correctly link to documentation pages using just the numeric portion of the diagnostic ID.
The changes include:
src/Shared/Obsoletions.cs
using Microsoft.AspNetCore.Shared;
directive to files referencing Obsoletions constantsThis approach ensures URLs like
https://aka.ms/aspnet/deprecate/003
are generated (with just the numeric part) instead ofhttps://aka.ms/aspnet/deprecate/ASPDEPR003
(which would be incorrect).Fixes broken documentation links for obsolete APIs in Visual Studio
Customer Impact
Developers using deprecated ASP.NET Core APIs will now see working documentation links in Visual Studio instead of broken URLs. This improves the developer experience by providing immediate access to migration guidance and deprecation information when encountering obsolete APIs.
Regression?
This change only adds missing UrlFormat parameters to existing obsolete attributes, improving existing functionality without changing behavior.
Risk
Low risk - This change only adds URL references to existing obsolete attributes without modifying any functional code. The changes are additive and don't affect runtime behavior. All projects build successfully with the updated references.
Verification
Packaging changes reviewed?
When servicing release/2.3