@@ -50,6 +50,11 @@ public override CommandResult Invoke()
5050 return CommandResult . Dismiss ( ) ;
5151 }
5252
53+ if ( page != null )
54+ {
55+ Task . Run ( ( ) => page . UpdateFrequencyAsync ( Workspace . Path ) ) ;
56+ }
57+
5358 OpenWindows . Instance . UpdateVisualStudioWindowsList ( ) ;
5459 var visualStudioWindows = OpenWindows . Instance . Windows ;
5560 var matchedElevatedVisualStudioWindows = new List < Window > ( ) ;
@@ -65,6 +70,10 @@ public override CommandResult Invoke()
6570 }
6671 else
6772 {
73+ if ( window . Process . Process == null )
74+ {
75+ continue ;
76+ }
6877 string ? commandLine = NativeProcessCommandLine . GetCommandLine ( window . Process . Process ) ;
6978 string ? solutionPath = NativeProcessCommandLine . ExtractSolutionPath ( commandLine ) ;
7079 if ( solutionPath == Workspace . WindowsPath )
@@ -77,22 +86,17 @@ public override CommandResult Invoke()
7786
7887 //if (matchedElevatedVisualStudioWindows.Count > 0)
7988 //{
80- // TODO: Waiting on https://github.com/microsoft/PowerToys/pull/38025 for GotoPage support.
81- // Since we can't retrieve the command line from elevated processes, we can't determine their solution path.
82- // If any elevated Visual Studio windows have a title that contains the solution name,
83- // consider navigating to a selection page to let the user choose which window to switch to or reopen the solution.
89+ // TODO: Waiting on https://github.com/microsoft/PowerToys/pull/38025 for GotoPage support.
90+ // Since we can't retrieve the command line from elevated processes, we can't determine their solution path.
91+ // If any elevated Visual Studio windows have a title that contains the solution name,
92+ // consider navigating to a selection page to let the user choose which window to switch to or reopen the solution.
8493 //}
8594
8695 if ( Workspace . VSInstance != null )
8796 {
8897 OpenInShellHelper . OpenInShell ( Workspace . VSInstance . InstancePath , Workspace . Path , runAs : _elevated ? OpenInShellHelper . ShellRunAsType . Administrator : OpenInShellHelper . ShellRunAsType . None ) ;
8998 }
9099
91- if ( page != null )
92- {
93- Task . Run ( ( ) => page . UpdateFrequencyAsync ( Workspace . Path ) ) ;
94- }
95-
96100 return PageCommandResultHandler . HandleCommandResult ( page ) ;
97101 }
98102}
0 commit comments