Format C# When Opened and SavedFormat C# When Opened and Saved is a lightweight Visual Studio extension that automatically formats C# files using CSharpier whenever a file is opened or saved. The extension is designed for developers who want consistent C# formatting without having to manually run a formatter or remember extra commands. When a Features
How It WorksWhen Visual Studio loads the extension, it subscribes to document open and save events. For each C# document, the extension reads the current editor text, runs CSharpier, and replaces the document contents only when formatting changes are detected. Diagnostic messages are written to the Visual Studio Output window under:
This makes it easier to confirm when formatting runs successfully or to troubleshoot CSharpier installation and command-line issues. RequirementsCSharpier must be available to the project being formatted. You can install CSharpier globally:
Or install it as a local .NET tool in the repository you want to format. After installing CSharpier globally, restart Visual Studio so the extension can resolve the updated tool path. Recommended UseThis extension is useful for teams or individual developers who want automatic C# formatting without manually invoking CSharpier. It is especially helpful when working across large solutions where consistent formatting should happen naturally as files are edited and saved. TroubleshootingOpen Visual Studio’s Output window and select:
The extension logs initialization, formatting success, skipped files, and CSharpier errors there. |