This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,8 @@ async Task CheckBindingPathsAsync()
188188 // When running in the Exp instance, ensure there is only one active binding path.
189189 // This is necessary when the regular (AllUsers) extension is also installed.
190190 // See: https://github.com/github/VisualStudio/issues/1995
191- await BindingPathHelper . CheckBindingPathsAsync ( GetType ( ) . Assembly , JoinableTaskFactory , this ) ;
191+ await JoinableTaskFactory . SwitchToMainThreadAsync ( ) ;
192+ BindingPathHelper . CheckBindingPaths ( GetType ( ) . Assembly , this ) ;
192193 }
193194 catch ( Exception e )
194195 {
Original file line number Diff line number Diff line change 66using GitHub . Logging ;
77using Microsoft . VisualStudio . Shell ;
88using Microsoft . VisualStudio . Shell . Interop ;
9- using Microsoft . VisualStudio . Threading ;
109using Serilog ;
11- using Task = System . Threading . Tasks . Task ;
1210
1311namespace GitHub . VisualStudio . Helpers
1412{
@@ -23,13 +21,11 @@ class BindingPathHelper
2321 {
2422 static readonly ILogger log = LogManager . ForContext < BindingPathHelper > ( ) ;
2523
26- internal async static Task CheckBindingPathsAsync (
27- Assembly assembly ,
28- JoinableTaskFactory jtf ,
29- IServiceProvider serviceProvider )
24+ internal static void CheckBindingPaths ( Assembly assembly , IServiceProvider serviceProvider )
3025 {
3126 log . Information ( "Looking for assembly on wrong binding path" ) ;
3227
28+ ThreadHelper . CheckAccess ( ) ;
3329 var bindingPaths = BindingPathUtilities . FindBindingPaths ( serviceProvider ) ;
3430 var bindingPath = BindingPathUtilities . FindRedundantBindingPaths ( bindingPaths , assembly . Location )
3531 . FirstOrDefault ( ) ;
@@ -42,7 +38,6 @@ internal async static Task CheckBindingPathsAsync(
4238 // Log what has been detected
4339 log . Warning ( "Found assembly on wrong binding path {BindingPath}" , bindingPath ) ;
4440
45- await jtf . SwitchToMainThreadAsync ( ) ;
4641 var message = string . Format ( @"Found assembly on wrong binding path:
4742{0}
4843
You can’t perform that action at this time.
0 commit comments