ResXLocalization.WPF 1.0.0

dotnet add package ResXLocalization.WPF --version 1.0.0
                    
NuGet\Install-Package ResXLocalization.WPF -Version 1.0.0
                    
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="ResXLocalization.WPF" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ResXLocalization.WPF" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ResXLocalization.WPF" />
                    
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 ResXLocalization.WPF --version 1.0.0
                    
#r "nuget: ResXLocalization.WPF, 1.0.0"
                    
#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 ResXLocalization.WPF@1.0.0
                    
#: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=ResXLocalization.WPF&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ResXLocalization.WPF&version=1.0.0
                    
Install as a Cake Tool

ResXLocalization

Type-safe .resx localization for Avalonia and WPF - switch language live, write zero csproj boilerplate.

ResXLocalization takes the .resx files you already know and adds:

  • Live, no-reload language switching - set one property and every bound string updates in place.
  • 🔒 Type-safe, compile-checked keys - a Roslyn source generator turns every .resx into strongly-typed keys, so a renamed or deleted resource becomes a compile error, not a runtime surprise.
  • 🗂️ First-class multiple .resx support - look up by typed key, scope to one file, or search across all registered files.
  • 🔤 Enum localization built in - localize enum members by convention.
  • 🧮 Format arguments - Get(key, args…) formats in the active culture.
  • 🩺 Missing-translation diagnostics - a visible, configurable !key! sentinel plus a TranslationNotFound event.
  • 🌐 Language-picker ready - GetAvailableCultures() discovers the cultures your app actually ships.
  • 🚀 Native AOT & trim clean (Avalonia package) - zero IL2026/IL3050, no reflection over your resources.
  • 📦 One package, zero csproj boilerplate - runtime engine, source generator, and MSBuild wiring ship together.

Normal .NET parent/neutral resource fallback applies. TranslationNotFound is raised only when a key is unresolved across the complete fallback chain, not when a satellite entry falls back successfully.

Typed keys are generated for string entries in dot-free neutral .resx files that have a same-folder classic .Designer.cs accessor. Satellite files, non-string entries, files without that designer, and SDK GenerateResxSource accessors are not eligible.

Malformed eligible files produce the RXLGEN001 build diagnostic. Accessor namespaces and types are read from C# syntax, including file-scoped/global namespaces and imported or aliased System.Resources.ResourceManager types.

Quick start


<TextBlock Text="{l:Localize {x:Static res:AppStringsKeys.Greeting}}" />
// Register your resources once at startup …
Localizer.Current.RegisterResourceManager(AppStrings.ResourceManager);

// … then switch the whole UI to German - every bound string re-resolves in place, no reload.
Localizer.Current.CurrentCulture = new CultureInfo("de");

The XAML namespace to map:

Avalonia:  xmlns:l="clr-namespace:RentADeveloper.ResXLocalization.Avalonia;assembly=ResXLocalization.Avalonia"
WPF:       xmlns:l="clr-namespace:RentADeveloper.ResXLocalization.WPF;assembly=ResXLocalization.WPF"

Two packages, one engine

Package UI framework Targets Native AOT
ResXLocalization.Avalonia Avalonia 12 net8.0 · net10.0
ResXLocalization.WPF WPF net8.0-windows · net10.0-windows ❌ (WPF limitation)

Both share the same UI-agnostic engine (ILocalizer / Localizer.Current, ResourceKey), the same source generator, and the same MSBuild wiring.

Documentation

The full documentation - quick start, lookup modes, enum localization, multiple .resx files, Native AOT publishing, troubleshooting, and complete runnable sample apps for both frameworks - lives in the project README; the API reference documents every type.

License

Released under the MIT License. © 2026 David Liebeherr.

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed.  net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 0 7/13/2026