AcAFroese.ResxAnalyzers
1.0.5-prerelease
dotnet add package AcAFroese.ResxAnalyzers --version 1.0.5-prerelease
NuGet\Install-Package AcAFroese.ResxAnalyzers -Version 1.0.5-prerelease
<PackageReference Include="AcAFroese.ResxAnalyzers" Version="1.0.5-prerelease"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="AcAFroese.ResxAnalyzers" Version="1.0.5-prerelease" />
<PackageReference Include="AcAFroese.ResxAnalyzers"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add AcAFroese.ResxAnalyzers --version 1.0.5-prerelease
#r "nuget: AcAFroese.ResxAnalyzers, 1.0.5-prerelease"
#:package AcAFroese.ResxAnalyzers@1.0.5-prerelease
#addin nuget:?package=AcAFroese.ResxAnalyzers&version=1.0.5-prerelease&prerelease
#tool nuget:?package=AcAFroese.ResxAnalyzers&version=1.0.5-prerelease&prerelease
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 idAcAFroese.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.resxfiles and emits the strongly typed extension properties, plus theRESX001diagnostic analyzer.RoslynResxGenerator.CodeFixes— the code fix provider forRESX001, rewritinglocalizer["Key"]tolocalizer.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.
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.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 |