Dev Utils
Dev Utils automates the most repetitive C# development tasks directly
from the Solution Explorer context menu — right-click any project, folder,
file, or solution node and find the Dev Utils submenu.
Commands
Scans all public non-static classes in a project and generates
IClassName interfaces in bulk. Automatically adds the interface
to each class's base list and registers the new files in the project.
Generate DI Registration
Detects all IInterface → Class pairs in a project and generates
a static extension class with a single IServiceCollection method
containing all AddScoped<I, C>() registrations — ready to plug
into your Program.cs or Startup.cs.
DI Injection Analyzer
Scans the entire solution for classes that use registered
implementations via direct new ClassName() instead of constructor
injection. Displays a filterable dialog with status for each candidate:
| Status |
Meaning |
| ✔ Safe |
Ready to inject |
| ⚠ Warning |
Multiple constructors detected |
| ✖ Error |
Direct new in production code or incompatible constructor |
| ✔ Done |
Already injected |
Select one or more classes and click Inject — Dev Utils will:
- Add
private readonly IInterface _field;
- Add or update the constructor with the new parameter
- Replace all
new ClassName(...) usages with the field reference
- Remove redundant local variable declarations
- Unwrap
using (var x = new ClassName()) { } blocks
Formats every .cs file in a project or solution.
Auto-detects the best strategy:
- No
.editorconfig → runs dotnet format in the background (fast)
.editorconfig found → uses Visual Studio's built-in formatter
file by file to respect your custom rules
All operations are logged to the Dev Utils pane in the Output window.
Requirements
- Visual Studio 2022 (17.x)
- .NET Framework 4.7.2+
dotnet format fast path requires .NET SDK installed
Source Code
github.com/DiegoSDeveloper/DevUtilsExtensionVS