You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.NET Native AOT warnings from System.Net.Http #78367
Publishing an app with .NET Native AOT results in analysis warnings. Devs have confidence that their app works when no errors remain, so System.Net.Http shouldn't report warnings unless an AOT incompatible API is used from the assembly.
Reproduction Steps
Create a console app
Write code to create an HTTP request with HttpClient
/_/src/libraries/System.Net.Http/src/System/Net/Http/DiagnosticsHandler.cs(333): AOT analysis warning IL3050: System.Net.Http.DiagnosticsHandler.Write<T>(DiagnosticSource,St
ring,!!0): Using member 'System.Diagnostics.DiagnosticSource.Write(String,Object)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Diagn
osticSource may require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling. [C:\Development\Source\grpc-dot
net\examples\Transcoder\Server\Server.csproj]
The warning is potentially real if one enables EventSource (that we disabled by default in 7.0 for NativeAOT). But without opting in, it's just noise, because this won't throw.
@eerhardt made DiagnosticSource AOT-safe in #76109 and that would make the warning disappear (it shouldn't be warning in 8.0 anymore).
I know I said it probably doesn't meet the 7.0 bar in #76109 (comment) but I didn't consider the warning. The warning is annoying.
I triggered a backport on the PR to see if we can still slam it into the December update.
Ok, cool the backport failed because the bot cannot comment on the old PR. Fix in arcade: dotnet/arcade#11637
Meanwhile, I submitted #78372 with a cherry-pick to get a headstart on the CI. It's end of the day for me so I'll let the US time zone chase this if it's at all possible to get this in.
Activity
MichalStrehovsky commentedon Nov 15, 2022
The warning is potentially real if one enables EventSource (that we disabled by default in 7.0 for NativeAOT). But without opting in, it's just noise, because this won't throw.
@eerhardt made DiagnosticSource AOT-safe in #76109 and that would make the warning disappear (it shouldn't be warning in 8.0 anymore).
I know I said it probably doesn't meet the 7.0 bar in #76109 (comment) but I didn't consider the warning. The warning is annoying.
I triggered a backport on the PR to see if we can still slam it into the December update.
MichalStrehovsky commentedon Nov 15, 2022
Ok, cool the backport failed because the bot cannot comment on the old PR. Fix in arcade: dotnet/arcade#11637
Meanwhile, I submitted #78372 with a cherry-pick to get a headstart on the CI. It's end of the day for me so I'll let the US time zone chase this if it's at all possible to get this in.
MichalStrehovsky commentedon Jan 11, 2023
This will be fixed in 7.0.3 (#78532).