chore: replace 2-string Resources.resx with constants#1786
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR simplifies Microsoft.ComponentDetection.Common by replacing a 2-string .resx + auto-generated designer with an internal static Resources constants class, removing legacy .NET Framework resx artifacts and avoiding ResourceManager overhead.
Changes:
- Added
Resources.csexposing the two resource strings asinternal const string. - Removed
Resources.resxandResources.Designer.cs. - Deleted the resx-related
ItemGroupfrom the Common project file.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.ComponentDetection.Common/Resources.resx | Removes the unused 2-string resx resource file. |
| src/Microsoft.ComponentDetection.Common/Resources.Designer.cs | Removes the auto-generated ResourceManager-backed resource accessor. |
| src/Microsoft.ComponentDetection.Common/Resources.cs | Introduces an internal constants-based replacement for the previous resource accessor. |
| src/Microsoft.ComponentDetection.Common/Microsoft.ComponentDetection.Common.csproj | Removes the resx/designer build metadata entries. |
Copilot's findings
Files not reviewed (1)
- src/Microsoft.ComponentDetection.Common/Resources.Designer.cs: Language not supported
- Files reviewed: 3/4 changed files
- Comments generated: 2
grvillic
approved these changes
Apr 17, 2026
The resx contained only two never-localized strings and its <resheader> still referenced System.Windows.Forms. Replaced with an internal static Resources class with const strings; call sites are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
008bb49 to
3f0bca9
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1786 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
What
Replaces
src/Microsoft.ComponentDetection.Common/Resources.resxand its auto-generatedResources.Designer.cswith a small internal staticResourcesclass exposing the same two strings asconst string.Why
The resx file:
MissingComponentId,MissingNodeInDependencyGraph)System.Windows.Formsas its ResX reader/writer in<resheader>— a .NET Framework artifactA const class is simpler, lighter (no
ResourceManager), and keeps the same call sites compiling unchanged.Changes
Resources.cswith twointernal const stringmembersResources.resxandResources.Designer.csItemGroupfromMicrosoft.ComponentDetection.Common.csprojPart 3 of a 6-PR cleanup series removing .NET-Framework-era anachronisms.