Closed
Description
Description
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
- Publish with
<PublishAot>true</PublishAot>
Expected behavior
No warning from System.Net.Http
.
Actual behavior
I think it might be one error. I enabled this setting to get details: https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trimming-options?pivots=dotnet-7-0#show-detailed-warnings
/_/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]
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response