AutoRunCustomTool for VS2022⚠ Known issue: This extension doesn't fully work with SDK-style (.NET Core / .NET 5+) projects. It's usable, but without UI support; you'll need to manually set the A Visual Studio extension that automatically runs the custom tool on another file when a file is modified OK, I realize that this description is perhaps not very clear, so let's take an example. Let's assume (well, it's not really an assumption; it's actually the scenario that caused me to create this tool) that in your project, you can't (or don't want to) use the default custom tool for resx resource files. Instead, you use a T4 template to generate the code associated with the resx file. So you have 3 files :
The problem with this setup is that Visual Studio doesn't know that a change to Strings.resx should cause a regeneration of Strings.cs, so when you just added a resource to the resx file, it's not immediately available to your code, and doesn't appear in Intellisense. You have to right-click Strings.tt and select "Run custom tool" so that the template is run again. This is very annoying... This VS extension solves the problem very simply: when it detects a change to the "trigger" file (Strings.resx), it reruns the custom tool for the "target" file (Strings.tt). Note that this was just an example; the trigger file doesn't have to be a resx file, and the "target" file doesn't have to be a T4 template. Both can be anything you want, as long as the target has a custom tool defined. How to useAfter you install the extension, you should see a new Run custom tool on property on each project item. Just edit this property to add the name(s) of the target file(s). That's it! Here's a screenshot that shows how it works: |