Move hardcoded IL6001 warning string to Resources.resx#11594
Merged
jonathanpeppers merged 2 commits intoJun 8, 2026
Conversation
8 tasks
Add IL6001 resource entry to Properties/Resources.resx and Resources.Designer.cs. Update CheckForObsoletePreserveAttributeStep to use Resources.IL6001 with a using alias, matching the established convention in the Linker/MonoDroid.Tuner/ directory. Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix hardcoded IL6001 warning in CheckForObsoletePreserveAttributeStep
Move hardcoded IL6001 warning string to Resources.resx
Jun 6, 2026
jonathanpeppers
approved these changes
Jun 8, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves localization consistency in Xamarin.Android.Build.Tasks by moving the IL6001 warning text from an inline string literal into Properties/Resources.resx, so it can be localized and managed like other coded messages.
Changes:
- Added a new
IL6001entry tosrc/Xamarin.Android.Build.Tasks/Properties/Resources.resx. - Added the corresponding strongly-typed
Resources.IL6001accessor inResources.Designer.cs. - Updated
CheckForObsoletePreserveAttributeStepto logIL6001using the resource string + format argument.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Tasks/Properties/Resources.resx | Adds the IL6001 localized message string. |
| src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs | Exposes IL6001 via the generated strongly-typed resources API. |
| src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/CheckForObsoletePreserveAttributeStep.cs | Switches the warning to use Resources.IL6001 with the assembly name parameter. |
Files not reviewed (1)
- src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs: Language not supported
Comment on lines
+145
to
+147
| <data name="IL6001" xml:space="preserve"> | ||
| <value>Assembly '{0}' contains reference to obsolete attribute 'Android.Runtime.PreserveAttribute'. Members with this attribute may be trimmed. Please use System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute instead</value> | ||
| </data> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CheckForObsoletePreserveAttributeStep.cspasses a hardcoded string literal toLogCodedWarninginstead of using a resource string, making it non-localizable and inconsistent with the rest of the codebase.IL6001entry toProperties/Resources.resxwith{0}format placeholder for the assembly nameIL6001property toResources.Designer.csusing Resources = Xamarin.Android.Tasks.Properties.Resources;alias (matching existing convention inLinker/MonoDroid.Tuner/)Resources.IL6001reference:Warning message text is unchanged; existing
LinkerTests.csassertions remain valid.