PetchNaka.ResxFormatter.Cli 4.0.121

dotnet tool install --global PetchNaka.ResxFormatter.Cli --version 4.0.121
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local PetchNaka.ResxFormatter.Cli --version 4.0.121
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=PetchNaka.ResxFormatter.Cli&version=4.0.121
                    
nuke :add-package PetchNaka.ResxFormatter.Cli --version 4.0.121
                    

ResxFormatter

Optimizes resx files after saving: Removes schema and comments (in particular the 3KB documentation that is included in every resx file) and sorts entries alphabetically so that they look like this:

<?xml version="1.0" encoding="utf-8"?>
<root>
  <schema />
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <data name="a" xml:space="preserve">
    <value>LESS CLUTTER</value>
  </data>
  <data name="b" xml:space="preserve">
    <value>SORTED BY KEYS</value>
  </data>
</root>

Use only with a source control system and at your own risk. See the change log for changes and road map.


Download this extension from the Visual Studio Marketplace or get the CI build.

Build status

Settings

EditorConfig

Formatting rules are configured in the EditorConfig file as follows:

[*.resx]
resx_formatter_sort_entries=true
resx_formatter_remove_xsd_schema=true
resx_formatter_remove_documentation_comment=true
resx_formatter_sort_comparer=OrdinalIgnoreCase

Comparer can be one of the following: InvariantCulture, InvariantCultureIgnoreCase, OrdinalIgnoreCase, Ordinal. The default value is Ordinal.

When the EditorConfig Language Service version 1.18.35 or newer is installed, the ResxFormatter VSIX contributes these properties to its IntelliSense and validation. Restart Visual Studio after installing or updating either extension so that the custom schema is loaded.

ℹ️ You can format all resx files in the current solution folder via Extensions > ResxFormatter menu.

Visual Studio

A few things can be configured and probably you want to have this done as follows:

Settings

Use the experimental setting with caution since it may have undesired side effects. It is also worth to note, that the extension may insert schema or documentation comment in order to match the desired effect of your EditorConfig settings.

Agent Skill / CLI

Download resxfmt-<version>.zip from an AppVeyor build and extract its resxfmt directory into your Codex skills directory. The skill uses the PetchNaka.ResxFormatter.Cli .NET global tool and does not bundle an executable.

Invoke the agent skill with:

Use $resxfmt to check and format the .resx files in this repository.

The agent will detect when the tool is missing and can help install it. To install it directly, first install the .NET 10 SDK and then run:

dotnet tool install --global PetchNaka.ResxFormatter.Cli

Update an existing installation with:

dotnet tool update --global PetchNaka.ResxFormatter.Cli

Run resxfmt from the directory containing the resource files you want to process. The command syntax is resxfmt [options] [<path> ...]. Use --check to detect required changes without writing, --dry-run to preview, --recursive to include subdirectories, and --verbose for detailed output. Formatting follows the applicable EditorConfig settings; without a path, the current directory is processed.

The CLI reports updated, would-update, unchanged, skipped, or failed for each file. Exit code 1 means --check found pending changes; exit code 2 means a usage, path, access, or formatting failure.

Contributing

Please use the issue tracker for submitting bug reports or feature requests.

License

MIT License

Third Party Licenses

Library License
EditorConfig .NET Core MIT License
xUnit Apache License 2.0 / MIT License
NFluent Apache License 2.0
Community toolkit for Visual Studio extensions Apache License 2.0
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
4.0.121 130 7/31/2026
4.0.119 113 7/31/2026
4.0.115 122 7/30/2026