resx-source-generator-migration
Updates a project to use a more modern method of managing resources. It swaps the old system for a new, more efficient one.
What it does
This code helps update your software projects. It replaces an old way of handling resource files (texts, messages) with a more modern and efficient one, using a 'source code generator'.
When to use it
- ✓When you want to modernize an old project.
- ✓When optimizing your program's performance.
- ✓To simplify how texts are managed.
Example of what to ask your AI
“Migrate my project 'MyProject.csproj' to use the source generator for .resx files.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It adds a new tool to your project and removes old configurations that created extra code files. This causes the code to access texts to be generated automatically.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add github/awesome-copilot --skill resx-source-generator-migrationOr download just the file:
curl -L https://raw.githubusercontent.com/github/awesome-copilot/main/skills/resx-source-generator-migration/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Your goal is to migrate the project to use a source-generator for .resx files instead of checked-in .designer.cs files.
User Input
Amend the instructions below with the following user input. The user input is likely to be an absolute or repo-relative path to an msbuild project file or a directory containing an msbuild project to be migrated.
$ARGUMENTS
Migration
Complete each of the following sub-sections.
Opt into the source generator
Inspect the target's package-management setup and configured NuGet sources before adding the package:
- If the repository centrally manages package versions and already has a
PackageVersionforMicrosoft.CodeAnalysis.ResxSourceGenerator, add this versionless reference to anItemGroupin the project file:
<PackageReference Include="Microsoft.CodeAnalysis.ResxSourceGenerator" PrivateAssets="all" />
- If no central version exists, select a package version compatible with the target SDK/compiler and follow the repository's established version-management pattern. Specify the version on the
PackageReferenceor add the corresponding centralPackageVersion. - Verify that the configured NuGet sources can resolve the selected package. If they cannot, ask the user before changing feed configuration.
Remove traces of .resx code-behind files
Search for any msbuild items related to resx files. They typically come in pairs, as shown below:
<ItemGroup>
<Compile Update="Strings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
Note that you might also find <Generator>PublicResXFileCodeGenerator</Generator> (or <CustomTool> instead of <Generator>) as .resx item metadata.
For each strongly typed .resx file being migrated, identify its generated designer file using all of these signals:
LastGenOutputmetadata on theEmbeddedResourceitem;- a
Compileitem whoseDependentUponmetadata names the .resx file; and - a matching
*.Designer.csfile on disk, even when the SDK includes it implicitly and noCompileitem exists.
Before deleting a candidate, inspect its contents and confirm it is a generated resource accessor, such as a class containing ResourceManager, Culture, and properties that retrieve resource values. A matching filename alone is not sufficient. Do not delete WinForms or control designer files that contain UI initialization such as InitializeComponent; these commonly sit beside a same-named .resx file, and their DependentUpon metadata points to the form or control source file rather than the .resx file.
Also confirm that every resource exposed by the designer is a string and that the .resx file contains no images, icons, byte arrays, serialized objects, or other non-string values. This source generator emits string accessors backed by ResourceManager.GetString; it is not a compatible replacement for non-string resource properties. If any non-string resource exists, do not delete the designer or migrate that resource file. Keep its existing generation approach, or set <GenerateSource>false</GenerateSource> if the package would otherwise process it.
Before deletion, search the solution for every use and declaration of the accessor type. ResXFileCodeGenerator emits a non-static class, while this source generator emits a static partial class. Identify object construction, instance access, inheritance, use as a generic type argument (including IStringLocalizer<T>), and existing partial declarations with instance members, base types, or interfaces. Refactor each incompatible use to the static generated API and make every partial declaration compatible before migrating. If that is not appropriate, retain the existing designer and set <GenerateSource>false</GenerateSource> for that resource file.
For each associated designer file:
- Delete the
*.Designer.csfile from disk. - Remove its explicit MSBuild item from the project when one exists.
Update EmbeddedResource items
…
FAQ
What are .resx files?
These are files that store texts and messages used in your program, like button labels and error messages, to make translation and management easier.
What is a 'source code generator'?
It's a tool that writes code automatically for you, based on other information. In this case, it generates the code to access the texts from .resx files.
Do I need to worry about .Designer.cs files?
No, the goal of this update is precisely to eliminate the need for these automatically generated .Designer.cs files, making the process cleaner.
Details
Original description by the author
Migrates a project that uses checked-in .designer.cs files behind .resx to using a source-generator instead
repo: github/awesome-copilot
Popularity
- GitHub stars
- 40k
- Ranking position
- #5345
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
acquire-codebase-knowledge
Helps your agent understand and document an existing code project. It's useful for onboarding new people or getting an overview of the architecture.
github/awesome-copilot
acreadiness-assess
Enables your agent to assess a project's readiness for AI and generate a report. It's useful for understanding how well a project is prepared to use AI tools.
github/awesome-copilot
acreadiness-generate-instructions
Helps your agent create instructions for AI tools based on an assessment. It's useful for improving how AI interacts with code and closing identified gaps.
github/awesome-copilot
acreadiness-policy
Enables your agent to help define or apply policies for AI project assessment. It's useful for standardizing how projects are evaluated and ensuring compliance.
github/awesome-copilot
Similar skills
api-connector-builder
Has your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
affaan-m/ECC
api-design
Helps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
affaan-m/ECC
backend-patterns
Helps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.
affaan-m/ECC