-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
ILC and ILLink don't respect TrimmerSingleWarn in some cases #94799
Comments
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsDescriptionThere are a class of trimming warnings that still get emitted as Reproduction Steps
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishAot>true</PublishAot>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.0.0" />
<PackageReference Include="Polly.Core" Version="8.2.0" />
</ItemGroup>
</Project> (Note the same behavior occurs with using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
services
.AddHttpClient<WeatherClient>()
.AddStandardResilienceHandler();
public class WeatherClient() { } Expected behaviorSince the referenced library Actual behavior3 individual warnings are emitted instead:
Regression?No response Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
Is this from dotnet/linker#2087? That one was intentional. Do the original reasons not apply here? |
Ah, good call. This is something I forgot about, and it wasn't obvious to me that the reason these warnings weren't being single-warned was because the library had IsTrimmable on it. The good thing is that these warnings will be fixed by #94798, so they won't be seen soon. |
Description
There are a class of trimming warnings that still get emitted as
IL2026
from assemblies being referenced instead of theIL2104
that is supposed to be emitted when the warning comes from a referenced assembly.Reproduction Steps
dotnet publish
the following app(Note the same behavior occurs with
<PublishTrimmed>true</PublishTrimmed>
instead ofPublishAot
.)Expected behavior
Since the referenced library
Microsoft.Extensions.Http.Resilience
has trimming warnings the only warning that should be emitted is aIL2104
. This is the normal behavior when a referenced library has warnings.Actual behavior
3 individual warnings are emitted instead:
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: