I'm developing a Visual Studio 2022 extension with the Visual Studio Community Toolkit. The extension modifies some resx files and I'd like to run the associated custom tool to regenerate the corresponding *.Designer.cs file after a resx file is modified.
In another extension for a previous VS version, I was able to do it like this:
ProjectItem item = _dte.Solution.FindProjectItem(filename);
VSProjectItem vSProjectItem = item?.Object as VSProjectItem;
vSProjectItem?.RunCustomTool();
With _dte
being of type EnvDTE._DTE
. However now I can't find a way to get that _dte object. All I have is an static VS
that provides some basic features as the ones described here: https://learn.microsoft.com/en-us/visualstudio/extensibility/vsix/tips/files?view=vs-2022
However, I can't find there anything related to running a file's custom tool.