Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit fed313c

Browse files
committed
Only RationalizeBindingPaths on DEBUG builds
This doesn't need to run in production.
1 parent abf2772 commit fed313c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/GitHub.VisualStudio/GitHubPackage.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Linq;
32
using System.Threading;
43
using System.Threading.Tasks;
54
using System.ComponentModel.Design;
@@ -170,7 +169,9 @@ public sealed class ServiceProviderPackage : AsyncPackage, IServiceProviderPacka
170169

171170
protected override Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
172171
{
173-
BindingPathUtilities.RationalizeBindingPaths(GetType().Assembly.Location);
172+
// Ensure there is only one active binding path for the extension.
173+
// This is necessary when the regular (AllUsers) extension is installed.
174+
RationalizeBindingPaths();
174175

175176
AddService(typeof(IGitHubServiceProvider), CreateService, true);
176177
AddService(typeof(IVSGitExt), CreateService, true);
@@ -197,6 +198,13 @@ public async Task<IGitHubPaneViewModel> ShowGitHubPane()
197198
return await gitHubPane.GetViewModelAsync();
198199
}
199200

201+
[System.Diagnostics.Conditional("DEBUG")]
202+
void RationalizeBindingPaths()
203+
{
204+
log.Information("Rationalizing any duplicate binding paths");
205+
BindingPathUtilities.RationalizeBindingPaths(GetType().Assembly.Location);
206+
}
207+
200208
static ToolWindowPane ShowToolWindow(Guid windowGuid)
201209
{
202210
IVsWindowFrame frame;

0 commit comments

Comments
 (0)