dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.42k stars 4.76k forks source link

[release/8.0] Suppress IL3000 in MsQuicApi constructor #109965

Open rzikm opened 2 days ago

rzikm commented 2 days ago

A call to Assembly.Location was added in a recent fix. It has IL30000 suppressed via #pragma warning disable, but that only applies to the compilation of the library itself. Consumers will hit it when doing something like publishing their app as NativeAOT.

This change adds an [UnconditionalSuppressMessage] to the MsQuicApi static constructor such that IL30000 should also be suppressed for apps consuming the runtime.

Customer Impact

Customers are seeing a warning when NativeAoT compiling applications relying on HttpClient. Many customers also use option to treat warning as errors and thus are unable to build their applications without suppressing the warning.

Available workarounds are either

Regression

Regression against previous release. The same issue has discovered for 9.0 GA release and fixed before final build was created. However, the fix was not backported to 8.0.

Testing

The same change is present as part of 9.0 builds where the regression does not reproduce.

Risk

Low, no functional change, the issue pointed to by the warning is already correctly handled at runtime.

dotnet-policy-service[bot] commented 2 days ago

Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.