Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I programmatically refresh Visual Studio Solution Explorer?

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.

like image 432
joerage Avatar asked Mar 03 '10 19:03

joerage


People also ask

How do I refresh code in Visual Studio code?

Choose Refresh from the Window menu, or click the Refresh button in the toolbar.

How do I refresh a Visual Studio project?

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.

How do I get Solution Explorer code for Visual Studio?

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.


1 Answers

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)
like image 121
Ryan Lundy Avatar answered Sep 22 '22 06:09

Ryan Lundy