How can I programmatically refresh Visual Studio Solution Explorer?
I can get a hold of the solution explorer window object, but don't know what to do with it!
var solutionExplorer = (UIHierarchy)DTE.Windows.Item(Constants.vsext_wk_SProjectWindow).Object();
Thanks.
Choose Refresh from the Window menu, or click the Refresh button in the toolbar.
In Solution Explorer, select the projects you want to load (press Ctrl while clicking to select more than one project), and then right-click on the project and choose Reload Project. Visual Studio will remember which projects are loaded the next time you open the solution locally.
Open Solution Explorer If you don't see the Solution Explorer tool window, you can open it from the Visual Studio menu bar by using View > Solution Explorer, or by pressing Ctrl+Alt+L.
Usually you can figure out these things by recording a temporary macro, doing what you want to do, and seeing what comes out in the macro editor.
Indeed, this is a case where it's probably only by recording a temporary macro that you can figure out how to do this. Here's the command to refresh the Solution Explorer:
DTE.Commands.Raise("{1496A755-94DE-11D0-8C3F-00C04FC2AAE2}", 222, null, null)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With