Limit ITlsHandshakeFeature.Exception on Connections.Abstractions for #if NETCOREAPP#66300
Conversation
There was a problem hiding this comment.
Pull request overview
Aligns the ITlsHandshakeFeature.Exception API surface across the Connections.Abstractions netcoreapp TFMs (e.g., net10 and net11) for the same package version by gating it on NETCOREAPP and providing a default null implementation.
Changes:
- Switch
ITlsHandshakeFeature.Exceptioncompilation guard fromNET11_0_OR_GREATERtoNETCOREAPP. - Add the
Exceptiongetter to the net10 public API unshipped list.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Servers/Connections.Abstractions/src/PublicAPI/net10.0/PublicAPI.Unshipped.txt | Declares the new ITlsHandshakeFeature.Exception getter as part of the net10 API surface. |
| src/Servers/Connections.Abstractions/src/Features/ITlsHandshakeFeature.cs | Makes Exception available for all NETCOREAPP builds with a default null implementation. |
Agreed. Did you test out the preview package/dll with the net10 ASP.NET Core shared framework? I totally understand if you didn't. But if not, try to do this after this gets released as a preview at least. |
#65807 introduced
Exceptionproperty with#if NET_11_OR_GREATERwhich makes release of Connections.Abstractions be TFM dependant as well. We should make the APIs match across different TFMs for same NuGet version.I think simply returning
nullis ok here. I do not like the idea of throwing an exception as DIM, because that's an extra thing for the user to handle. For net10 apps referncing net11 NuGet package it will throw everytime, which is impacting perf for no reason