-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[release/6.0] Apply custom Message and Url to all [RequiresPreviewFeatures] attributes #60456
[release/6.0] Apply custom Message and Url to all [RequiresPreviewFeatures] attributes #60456
Conversation
Tagging subscribers to this area: @dotnet/area-system-runtime Issue DetailsBackport of #60379. Due to conflicts in Customer ImpactWith #56498, we have added When we sought approval for dotnet/roslyn-analyzers#5502, we stated that we would be following up with this PR. With this change, diagnostics reported will now provide more information about the preview feature that was used. For example, references to Generic Math APIs will now result in:
Without this change, all diagnostic messages from the preview APIs in dotnet/runtime are reported using the standard message:
The Kestrel HTTP/3 support for .NET 6 is already using custom messages/urls. TestingLocal testing validated the custom messages are now produced as expected. RiskMinimal. Assembly size is affected by adding the strings into the attributes. This is minimized by the generic math API refs being excluded from the shared framework and only included if the System.Runtime.Experimental package is installed.
|
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Backport of #60379. Due to conflicts in
eng/Versions.props
from differences between main and release/6.0, this backport was crafted manually by cherry-picking the commits from #60379. The package version for the NetAnalyzers was set to be the latest version number from the dotnet6 feed.Customer Impact
With #56498, we have added
Message
andUrl
properties to theRequiresPreviewFeatures
attribute. With dotnet/roslyn-analyzers#5502, the analyzer now includes thoseMessage
andUrl
properties in the diagnostic messages raised. This change updates the existing[RequiresPreviewFeatures]
attributes across thedotnet/runtime
repo to apply custom messages and urls.When we sought approval for dotnet/roslyn-analyzers#5502, we stated that we would be following up with this PR. With this change, diagnostics reported will now provide more information about the preview feature that was used. For example, references to Generic Math APIs will now result in:
Without this change, all diagnostic messages from the preview APIs in dotnet/runtime are reported using the standard message:
The Kestrel HTTP/3 support for .NET 6 is already using custom messages/urls.
Testing
Local testing validated the custom messages are now produced as expected.
Risk
Minimal. Additional properties added into attribute metadata, but no runtime behavior changes.