-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add [RequiresPreviewFeaturesAttribute] to Http3 #34810
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
Conversation
|
How does this show up in the sample app, as a warning?
Do we need a suppression there? |
So I guess we either need to suppress it, or have the sample require preview features as well? |
|
That's a runtime error about your machine not supporting quic. The preview attribute should have given you a compile time warning/error? |
|
Nope, no warnings/errors on building the app |
|
Hmm, then it's not working and we need to figure out why before merging it. |
|
@pgovind @jeffhandley @jkotas this PR adds the
|
|
The analyzer is currently set to produce |
Either this, or you can change the severity of the analyzer from |
|
Yeah, I do get |
|
That looks like what we want. https://aka.ms/dotnet-warnings/preview-features links to Bing? I'm guessing this will be fixed before .NET 6 RTMs. @pgovind @jeffhandley @jkotas Is there a reason why there is no way to add a custom message with this attribute? |
|
We typically don't set up the aka.ms links until documentation is in place and published, which won't happen until RC1 ships. (aka.ms defaults to bing for undefined links). I don't recall if the API Design Review discussion included potentially having a custom message. @pgovind / @terrajobst, was there a good reason not to? |
Interesting. We hadn't considered that because we didn't have a use case for it. @terrajobst should decide if we want to enable it. I'll just point out that adding a message might mean changes in S.P.CoreLib, so we should decide soon if we want it for .NET6 (or we just add it as a new features for .NET 7) |
|
For the context of HTTP/3, it would be nice to link to a doc about why the feature is preview, and how to manage using it, but it's not critical. Its like the ObsoleteAttribute where you want to describe why something is obsolete and how to update your app. In .NET 7 a constructor overload could be added to the attribute that takes a message. Give a chance to provide more detail to the user. |
|
Created issue: dotnet/runtime#56498 |
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.
I believe this was briefly discussed a few days ago. Yes, I believe the usage of [RequiresPreviewFeatures] is appropriate here and would communicate our intent (the capability to use Http3 is there, but it's not supported and only provided as a preview).
terrajobst
left a comment
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.
Clicked the wrong button because I'm a PM
Co-authored-by: Immo Landwerth <[email protected]>
Co-authored-by: Immo Landwerth <[email protected]>
|
If we do this, is there a reason why we wouldn't mark this API? namespace System.Net
{
public static class HttpVersion
{
[RequiresPreviewFeatures]
public static readonly Version Version30;
}
}@dotnet/ncl |
|
A client can upgrade to use HTTP/3 without it being configured using that setting. For example, Version = 2.0 and RequestedVersionOrHigher will upgrade to HTTP/3 without someone seeing the preview warning. That's why a runtime appcontext switch is better for their situation. |
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> | ||
| <!-- Turn off warnings about using preview features --> |
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.
Nit: might be good to add something like "because HTTP/3 is currently in preview state" or something here, so the intent is clear to someone in the future.
adityamandaleeka
left a comment
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.
LGTM aside from the minor nit.
src/Servers/Kestrel/samples/Http3SampleApp/Http3SampleApp.csproj
Outdated
Show resolved
Hide resolved
Co-authored-by: Immo Landwerth <[email protected]>
Fixes #34738. Confirmed in ILSpy that the attribute is present on the 2 enum values.