AcAFroese.ResxAnalyzers 1.0.5-prerelease

Suggested Alternatives

Pneuma.Localization.Resx

This is a prerelease version of AcAFroese.ResxAnalyzers.
dotnet add package AcAFroese.ResxAnalyzers --version 1.0.5-prerelease
                    
NuGet\Install-Package AcAFroese.ResxAnalyzers -Version 1.0.5-prerelease
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AcAFroese.ResxAnalyzers" Version="1.0.5-prerelease">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AcAFroese.ResxAnalyzers" Version="1.0.5-prerelease" />
                    
Directory.Packages.props
<PackageReference Include="AcAFroese.ResxAnalyzers">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AcAFroese.ResxAnalyzers --version 1.0.5-prerelease
                    
#r "nuget: AcAFroese.ResxAnalyzers, 1.0.5-prerelease"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AcAFroese.ResxAnalyzers@1.0.5-prerelease
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AcAFroese.ResxAnalyzers&version=1.0.5-prerelease&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=AcAFroese.ResxAnalyzers&version=1.0.5-prerelease&prerelease
                    
Install as a Cake Tool

RoslynResxGenerator

A Roslyn source generator and analyzer that gives you strongly typed access to .resx resources through IStringLocalizer<T>.

For every .resx file in a project, an extension class is generated with one property per resource key, so instead of an error-prone string indexer:

localizer["HelloWorld"]

you get a compiled, discoverable property:

localizer.HelloWorld

An accompanying analyzer (RESX001) flags existing indexer-style lookups and offers a code fix to rewrite them to the strongly typed property automatically.

Projects in src/

  • RoslynResxGenerator.Analyzers — the package that actually gets published (NuGet id AcAFroese.ResxAnalyzers). It has no code of its own; it just packs the two projects below into a single analyzer package.
  • RoslynResxGenerator.SourceGenerator — the incremental source generator that reads .resx files and emits the strongly typed extension properties, plus the RESX001 diagnostic analyzer.
  • RoslynResxGenerator.CodeFixes — the code fix provider for RESX001, rewriting localizer["Key"] to localizer.Key.

Usage

Reference the package in a project that uses Microsoft.Extensions.Localization:

<PackageReference Include="AcAFroese.ResxAnalyzers" Version="x.y.z" PrivateAssets="all" />

Then use IStringLocalizer<T> as usual — the strongly typed properties are generated automatically for each .resx file, and the analyzer/code fix will help migrate any existing indexer-style lookups.

See sample/RoslynResxGenerator.Sample for a working example.

License

MIT — see LICENSE.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5-prerelease 109 7/29/2026 1.0.5-prerelease is deprecated because it is no longer maintained.
1.0.4-prerelease 67 7/28/2026
1.0.3-prerelease 69 7/28/2026
1.0.2-prerelease 62 7/28/2026
1.0.1-prerelease 63 7/27/2026
1.0.0-prerelease 80 7/27/2026