-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add suppression messages for assembly file path access #120213
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
base: main
Are you sure you want to change the base?
Conversation
When calling Assembly.GetFile, you get 2 trim warnings - IL3001 and IL3002. This was only suppressing one of these warnings. Adding the suppression for the other with the same justification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a missing suppression for the IL3001 trim warning related to assembly file path access. The existing code already had suppression for IL3002 but was missing IL3001, both of which are triggered by Assembly.GetFile calls.
- Adds UnconditionalSuppressMessage attribute for IL3001 warning
- Uses the same justification as the existing IL3002 suppression
That sounds like a bug to me. IL3001 was a somewhat unsystematic addition and the tool generating the more general IL3002 is likely not special casing for it. It should likely only generate the special IL3001. |
Calling Assembly.GetFile only produces `IL3001`. It doesn't produce `IL3002`.
Good call. I tested it in a standalone app: typeof(Program).Assembly.GetFile("ConsoleApp13.dll"); And it only produces
I've replaced the suppression with the right number. |
@MichalStrehovsky - it looks like there is a bug here somewhere. The build is now failing with
So it looks like the trimmer is raising |
When calling Assembly.GetFile, you get
IL3001
trim warning and notIL3002
.Changing the suppression to the correct warning.