From 9ac1a9be76a3757d28a00ef35d245fad966c15ba Mon Sep 17 00:00:00 2001 From: Arkady Shapkin Date: Wed, 26 Mar 2014 17:27:00 +0400 Subject: [PATCH 1/3] Assemblies loading for Policy Evaluator and Checkintool improved. Refs #258 --- GitTfs.Vs2008/TfsHelper.Vs2008.cs | 2 + GitTfs.Vs2010/TfsHelper.Vs2010.cs | 47 ++------------ GitTfs.Vs2012/TfsHelper.Vs2012.cs | 14 +++-- GitTfs.Vs2013/TfsHelper.Vs2013.cs | 8 ++- GitTfs.VsCommon/TfsHelper.Common.cs | 3 +- .../TfsHelper.PostVs2010.Common.cs | 62 +++++++++++++++++++ GitTfs.VsCommon/TfsHelper.Vs2012Base.cs | 43 ------------- GitTfs.VsFake/TfsHelper.VsFake.cs | 2 + GitTfs/Core/TfsInterop/ITfsHelper.cs | 1 + GitTfs/Core/TfsWorkspace.cs | 5 +- GitTfs/GitTfs.csproj | 4 ++ GitTfs/app.manifest | 25 ++++++++ 12 files changed, 125 insertions(+), 91 deletions(-) create mode 100644 GitTfs/app.manifest diff --git a/GitTfs.Vs2008/TfsHelper.Vs2008.cs b/GitTfs.Vs2008/TfsHelper.Vs2008.cs index 8c9d4523..ecbbbc56 100644 --- a/GitTfs.Vs2008/TfsHelper.Vs2008.cs +++ b/GitTfs.Vs2008/TfsHelper.Vs2008.cs @@ -48,6 +48,8 @@ namespace Sep.Git.Tfs.Vs2008 return VersionControl.AuthenticatedUser; } + public void SetPathResolver() { } + public override bool CanShowCheckinDialog { get { return false; } diff --git a/GitTfs.Vs2010/TfsHelper.Vs2010.cs b/GitTfs.Vs2010/TfsHelper.Vs2010.cs index 0ca30229..a2a03b69 100644 --- a/GitTfs.Vs2010/TfsHelper.Vs2010.cs +++ b/GitTfs.Vs2010/TfsHelper.Vs2010.cs @@ -71,51 +71,16 @@ namespace Sep.Git.Tfs.Vs2010 return VersionControl.AuthorizedUser; } - public override bool CanShowCheckinDialog { get { return true; } } + private string vsInstallDir; - public override long ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable checkedInfos, string checkinComment) + protected override string GetVsInstallDir() { - return ShowCheckinDialog(_bridge.Unwrap(workspace), - pendingChanges.Select(p => _bridge.Unwrap(p)).ToArray(), - checkedInfos.Select(c => _bridge.Unwrap(c)).ToArray(), - checkinComment); - } - - private long ShowCheckinDialog(Workspace workspace, PendingChange[] pendingChanges, - WorkItemCheckedInfo[] checkedInfos, string checkinComment) - { - using (var parentForm = new ParentForm()) + if (vsInstallDir == null) { - parentForm.Show(); - - var dialog = Activator.CreateInstance(GetCheckinDialogType(), new object[] {workspace.VersionControlServer}); - - return dialog.Call("Show", parentForm.Handle, workspace, pendingChanges, pendingChanges, - checkinComment, null, null, checkedInfos); + vsInstallDir = TryGetRegString(@"Software\Microsoft\VisualStudio\10.0", "InstallDir") + ?? TryGetRegString(@"Software\WOW6432Node\Microsoft\VisualStudio\10.0", "InstallDir"); } - } - - private const string DialogAssemblyName = "Microsoft.TeamFoundation.VersionControl.ControlAdapter"; - - private static Type GetCheckinDialogType() - { - return GetDialogAssembly().GetType(DialogAssemblyName + ".CheckinDialog"); - } - - private static Assembly GetDialogAssembly() - { - return Assembly.LoadFrom(GetDialogAssemblyPath()); - } - - private static string GetDialogAssemblyPath() - { - return Path.Combine(GetVs2010InstallDir(), "PrivateAssemblies", DialogAssemblyName + ".dll"); - } - - private static string GetVs2010InstallDir() - { - return TryGetRegString(@"Software\Microsoft\VisualStudio\10.0", "InstallDir") - ?? TryGetRegString(@"Software\WOW6432Node\Microsoft\VisualStudio\10.0", "InstallDir"); + return vsInstallDir; } private static string TryGetRegString(string path, string name) diff --git a/GitTfs.Vs2012/TfsHelper.Vs2012.cs b/GitTfs.Vs2012/TfsHelper.Vs2012.cs index 30acdb86..0cab79f6 100644 --- a/GitTfs.Vs2012/TfsHelper.Vs2012.cs +++ b/GitTfs.Vs2012/TfsHelper.Vs2012.cs @@ -10,12 +10,18 @@ namespace Sep.Git.Tfs.Vs2012 { } + private string vsInstallDir; + protected override string GetVsInstallDir() { - return TryGetRegString(@"Software\Microsoft\VisualStudio\11.0", "InstallDir") - ?? TryGetRegString(@"Software\WOW6432Node\Microsoft\VisualStudio\11.0", "InstallDir") - ?? TryGetUserRegString(@"Software\Microsoft\WDExpress\11.0_Config", "InstallDir") - ?? TryGetUserRegString(@"Software\WOW6432Node\Microsoft\WDExpress\11.0_Config", "InstallDir"); + if (vsInstallDir == null) + { + vsInstallDir = TryGetRegString(@"Software\Microsoft\VisualStudio\11.0", "InstallDir") + ?? TryGetRegString(@"Software\WOW6432Node\Microsoft\VisualStudio\11.0", "InstallDir") + ?? TryGetUserRegString(@"Software\Microsoft\WDExpress\11.0_Config", "InstallDir") + ?? TryGetUserRegString(@"Software\WOW6432Node\Microsoft\WDExpress\11.0_Config", "InstallDir"); + } + return vsInstallDir; } } } diff --git a/GitTfs.Vs2013/TfsHelper.Vs2013.cs b/GitTfs.Vs2013/TfsHelper.Vs2013.cs index 5643dd91..c71656d1 100644 --- a/GitTfs.Vs2013/TfsHelper.Vs2013.cs +++ b/GitTfs.Vs2013/TfsHelper.Vs2013.cs @@ -10,12 +10,18 @@ namespace Sep.Git.Tfs.Vs2013 { } + private string vsInstallDir; + protected override string GetVsInstallDir() { - return TryGetRegString(@"Software\Microsoft\VisualStudio\12.0", "InstallDir") + if (vsInstallDir == null) + { + vsInstallDir = TryGetRegString(@"Software\Microsoft\VisualStudio\12.0", "InstallDir") ?? TryGetRegString(@"Software\WOW6432Node\Microsoft\VisualStudio\12.0", "InstallDir") ?? TryGetUserRegString(@"Software\Microsoft\WDExpress\12.0_Config", "InstallDir") ?? TryGetUserRegString(@"Software\WOW6432Node\Microsoft\WDExpress\12.0_Config", "InstallDir"); + } + return vsInstallDir; } } } diff --git a/GitTfs.VsCommon/TfsHelper.Common.cs b/GitTfs.VsCommon/TfsHelper.Common.cs index e2b23ec2..29c2f6ba 100644 --- a/GitTfs.VsCommon/TfsHelper.Common.cs +++ b/GitTfs.VsCommon/TfsHelper.Common.cs @@ -15,7 +15,6 @@ using Sep.Git.Tfs.Core.TfsInterop; using Sep.Git.Tfs.Util; using StructureMap; using StructureMap.Attributes; -using ChangeType = Microsoft.TeamFoundation.Server.ChangeType; namespace Sep.Git.Tfs.VsCommon { @@ -364,6 +363,8 @@ namespace Sep.Git.Tfs.VsCommon protected abstract string GetAuthenticatedUser(); + public abstract void SetPathResolver(); + public abstract bool CanShowCheckinDialog { get; } public ITfsChangeset GetShelvesetData(IGitTfsRemote remote, string shelvesetOwner, string shelvesetName) diff --git a/GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs b/GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs index 2e79ed3d..67afec55 100644 --- a/GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs +++ b/GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs @@ -3,11 +3,14 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; +using System.Reflection; using Microsoft.TeamFoundation.Client; using Microsoft.TeamFoundation.VersionControl.Client; using Sep.Git.Tfs.Core; using Sep.Git.Tfs.Core.TfsInterop; +using Sep.Git.Tfs.Util; using StructureMap; +using ChangeType = Microsoft.TeamFoundation.VersionControl.Client.ChangeType; namespace Sep.Git.Tfs.VsCommon { @@ -214,6 +217,65 @@ namespace Sep.Git.Tfs.VsCommon { VersionControl.CreateBranchObject(new BranchProperties(new ItemIdentifier(tfsRepositoryPath))); } + + protected abstract string GetVsInstallDir(); + + public override void SetPathResolver() + { + AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(LoadFromVSFolder); + + } + + Assembly LoadFromVSFolder(object sender, ResolveEventArgs args) + { + string folderPath = Path.Combine(GetVsInstallDir(), "PrivateAssemblies"); + string assemblyPath = Path.Combine(folderPath, new AssemblyName(args.Name).Name + ".dll"); + if (File.Exists(assemblyPath) == false) + return null; + Assembly assembly = Assembly.LoadFrom(assemblyPath); + return assembly; + } + + public override bool CanShowCheckinDialog { get { return true; } } + + public override long ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable checkedInfos, string checkinComment) + { + return ShowCheckinDialog(_bridge.Unwrap(workspace), + pendingChanges.Select(p => _bridge.Unwrap(p)).ToArray(), + checkedInfos.Select(c => _bridge.Unwrap(c)).ToArray(), + checkinComment); + } + + private long ShowCheckinDialog(Workspace workspace, PendingChange[] pendingChanges, + WorkItemCheckedInfo[] checkedInfos, string checkinComment) + { + using (var parentForm = new ParentForm()) + { + parentForm.Show(); + + var dialog = Activator.CreateInstance(GetCheckinDialogType(), new object[] { workspace.VersionControlServer }); + + return dialog.Call("Show", parentForm.Handle, workspace, pendingChanges, pendingChanges, + checkinComment, null, null, checkedInfos); + } + } + + private const string DialogAssemblyName = "Microsoft.TeamFoundation.VersionControl.ControlAdapter"; + + private Type GetCheckinDialogType() + { + return GetDialogAssembly().GetType(DialogAssemblyName + ".CheckinDialog"); + } + + private Assembly GetDialogAssembly() + { + return Assembly.LoadFrom(GetDialogAssemblyPath()); + } + + private string GetDialogAssemblyPath() + { + return Path.Combine(GetVsInstallDir(), "PrivateAssemblies", DialogAssemblyName + ".dll"); + } } } diff --git a/GitTfs.VsCommon/TfsHelper.Vs2012Base.cs b/GitTfs.VsCommon/TfsHelper.Vs2012Base.cs index 47cd58e9..726e7d89 100644 --- a/GitTfs.VsCommon/TfsHelper.Vs2012Base.cs +++ b/GitTfs.VsCommon/TfsHelper.Vs2012Base.cs @@ -76,49 +76,6 @@ namespace Sep.Git.Tfs.VsCommon return Retry.Do(() => changeset.AssociatedWorkItems.Length > 0); } - public override bool CanShowCheckinDialog { get { return true; } } - - public override long ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable checkedInfos, string checkinComment) - { - return ShowCheckinDialog(_bridge.Unwrap(workspace), - pendingChanges.Select(p => _bridge.Unwrap(p)).ToArray(), - checkedInfos.Select(c => _bridge.Unwrap(c)).ToArray(), - checkinComment); - } - - private long ShowCheckinDialog(Workspace workspace, PendingChange[] pendingChanges, - WorkItemCheckedInfo[] checkedInfos, string checkinComment) - { - using (var parentForm = new ParentForm()) - { - parentForm.Show(); - - var dialog = Activator.CreateInstance(GetCheckinDialogType(), new object[] {workspace.VersionControlServer}); - - return dialog.Call("Show", parentForm.Handle, workspace, pendingChanges, pendingChanges, - checkinComment, null, null, checkedInfos); - } - } - - private const string DialogAssemblyName = "Microsoft.TeamFoundation.VersionControl.ControlAdapter"; - - private Type GetCheckinDialogType() - { - return GetDialogAssembly().GetType(DialogAssemblyName + ".CheckinDialog"); - } - - private Assembly GetDialogAssembly() - { - return Assembly.LoadFrom(GetDialogAssemblyPath()); - } - - private string GetDialogAssemblyPath() - { - return Path.Combine(GetVsInstallDir(), "PrivateAssemblies", DialogAssemblyName + ".dll"); - } - - protected abstract string GetVsInstallDir(); - protected string TryGetUserRegString(string path, string name) { return TryGetRegString(Registry.CurrentUser, path, name); diff --git a/GitTfs.VsFake/TfsHelper.VsFake.cs b/GitTfs.VsFake/TfsHelper.VsFake.cs index 45f37f29..468dcf45 100644 --- a/GitTfs.VsFake/TfsHelper.VsFake.cs +++ b/GitTfs.VsFake/TfsHelper.VsFake.cs @@ -45,6 +45,8 @@ namespace Sep.Git.Tfs.VsFake public void EnsureAuthenticated() {} + public void SetPathResolver() {} + public bool CanShowCheckinDialog { get { return false; } } public long ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable checkedInfos, string checkinComment) diff --git a/GitTfs/Core/TfsInterop/ITfsHelper.cs b/GitTfs/Core/TfsInterop/ITfsHelper.cs index 69822c49..60d4ce73 100644 --- a/GitTfs/Core/TfsInterop/ITfsHelper.cs +++ b/GitTfs/Core/TfsInterop/ITfsHelper.cs @@ -23,6 +23,7 @@ namespace Sep.Git.Tfs.Core.TfsInterop bool HasShelveset(string shelvesetName); ITfsChangeset GetShelvesetData(IGitTfsRemote remote, string shelvesetOwner, string shelvesetName); int ListShelvesets(ShelveList shelveList, IGitTfsRemote remote); + void SetPathResolver(); bool CanShowCheckinDialog { get; } long ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable checkedInfos, string checkinComment); void CleanupWorkspaces(string workingDirectory); diff --git a/GitTfs/Core/TfsWorkspace.cs b/GitTfs/Core/TfsWorkspace.cs index ac339f9b..bcb4c456 100644 --- a/GitTfs/Core/TfsWorkspace.cs +++ b/GitTfs/Core/TfsWorkspace.cs @@ -44,6 +44,7 @@ namespace Sep.Git.Tfs.Core shelveset.WorkItemInfo = GetWorkItemInfos().ToArray(); if (evaluateCheckinPolicies) { + _tfsHelper.SetPathResolver(); foreach (var message in _policyEvaluator.EvaluateCheckin(_workspace, pendingChanges, shelveset.Comment, null, shelveset.WorkItemInfo).Messages) { _stdout.WriteLine("[Checkin Policy] " + message); @@ -63,9 +64,10 @@ namespace Sep.Git.Tfs.Core if (string.IsNullOrWhiteSpace(checkinComment) && !_checkinOptions.NoGenerateCheckinComment) checkinComment = generateCheckinComment(); + _tfsHelper.SetPathResolver(); var newChangesetId = _tfsHelper.ShowCheckinDialog(_workspace, pendingChanges, GetWorkItemCheckedInfos(), checkinComment); if (newChangesetId <= 0) - throw new GitTfsException("Checkin cancelled!"); + throw new GitTfsException("Checkin canceled!"); return newChangesetId; } @@ -86,6 +88,7 @@ namespace Sep.Git.Tfs.Core var workItemInfos = GetWorkItemInfos(options); var checkinNote = _tfsHelper.CreateCheckinNote(options.CheckinNotes); + _tfsHelper.SetPathResolver(); var checkinProblems = _policyEvaluator.EvaluateCheckin(_workspace, pendingChanges, options.CheckinComment, checkinNote, workItemInfos); if (checkinProblems.HasErrors) { diff --git a/GitTfs/GitTfs.csproj b/GitTfs/GitTfs.csproj index b78d8d0a..eac1cff9 100644 --- a/GitTfs/GitTfs.csproj +++ b/GitTfs/GitTfs.csproj @@ -88,6 +88,9 @@ true true + + app.manifest + False @@ -254,6 +257,7 @@ Always + diff --git a/GitTfs/app.manifest b/GitTfs/app.manifest new file mode 100644 index 00000000..10cfbf5a --- /dev/null +++ b/GitTfs/app.manifest @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + From 3eefa1b7605ea74f4fb7114d9c7afc92dfd4ae6d Mon Sep 17 00:00:00 2001 From: Matt Burke Date: Mon, 14 Apr 2014 14:01:36 -0400 Subject: [PATCH 2/3] Move the path resolver to the constructor. This will ensure that it's in place before evaluating checkin policies, which is when it is needed, without expanding the interface of ITfsHelper. --- GitTfs.VsCommon/TfsHelper.Common.cs | 2 -- GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs | 12 ++++++------ GitTfs/Core/TfsInterop/ITfsHelper.cs | 1 - GitTfs/Core/TfsWorkspace.cs | 3 --- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/GitTfs.VsCommon/TfsHelper.Common.cs b/GitTfs.VsCommon/TfsHelper.Common.cs index 29c2f6ba..89f60e02 100644 --- a/GitTfs.VsCommon/TfsHelper.Common.cs +++ b/GitTfs.VsCommon/TfsHelper.Common.cs @@ -363,8 +363,6 @@ namespace Sep.Git.Tfs.VsCommon protected abstract string GetAuthenticatedUser(); - public abstract void SetPathResolver(); - public abstract bool CanShowCheckinDialog { get; } public ITfsChangeset GetShelvesetData(IGitTfsRemote remote, string shelvesetOwner, string shelvesetName) diff --git a/GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs b/GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs index 67afec55..f200179b 100644 --- a/GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs +++ b/GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs @@ -23,6 +23,7 @@ namespace Sep.Git.Tfs.VsCommon : base(stdout, bridge, container) { _bridge = bridge; + AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(LoadFromVSFolder); } public override bool CanGetBranchInformation @@ -220,18 +221,17 @@ namespace Sep.Git.Tfs.VsCommon protected abstract string GetVsInstallDir(); - public override void SetPathResolver() - { - AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(LoadFromVSFolder); - - } - + /// + /// Help the TFS client find checkin policy assemblies. + /// Assembly LoadFromVSFolder(object sender, ResolveEventArgs args) { + Trace.WriteLine("Looking for assembly " + args.Name + " ..."); string folderPath = Path.Combine(GetVsInstallDir(), "PrivateAssemblies"); string assemblyPath = Path.Combine(folderPath, new AssemblyName(args.Name).Name + ".dll"); if (File.Exists(assemblyPath) == false) return null; + Trace.WriteLine("... loading " + args.Name + " from " + assemblyPath); Assembly assembly = Assembly.LoadFrom(assemblyPath); return assembly; } diff --git a/GitTfs/Core/TfsInterop/ITfsHelper.cs b/GitTfs/Core/TfsInterop/ITfsHelper.cs index 60d4ce73..69822c49 100644 --- a/GitTfs/Core/TfsInterop/ITfsHelper.cs +++ b/GitTfs/Core/TfsInterop/ITfsHelper.cs @@ -23,7 +23,6 @@ namespace Sep.Git.Tfs.Core.TfsInterop bool HasShelveset(string shelvesetName); ITfsChangeset GetShelvesetData(IGitTfsRemote remote, string shelvesetOwner, string shelvesetName); int ListShelvesets(ShelveList shelveList, IGitTfsRemote remote); - void SetPathResolver(); bool CanShowCheckinDialog { get; } long ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable checkedInfos, string checkinComment); void CleanupWorkspaces(string workingDirectory); diff --git a/GitTfs/Core/TfsWorkspace.cs b/GitTfs/Core/TfsWorkspace.cs index bcb4c456..a4838525 100644 --- a/GitTfs/Core/TfsWorkspace.cs +++ b/GitTfs/Core/TfsWorkspace.cs @@ -44,7 +44,6 @@ namespace Sep.Git.Tfs.Core shelveset.WorkItemInfo = GetWorkItemInfos().ToArray(); if (evaluateCheckinPolicies) { - _tfsHelper.SetPathResolver(); foreach (var message in _policyEvaluator.EvaluateCheckin(_workspace, pendingChanges, shelveset.Comment, null, shelveset.WorkItemInfo).Messages) { _stdout.WriteLine("[Checkin Policy] " + message); @@ -64,7 +63,6 @@ namespace Sep.Git.Tfs.Core if (string.IsNullOrWhiteSpace(checkinComment) && !_checkinOptions.NoGenerateCheckinComment) checkinComment = generateCheckinComment(); - _tfsHelper.SetPathResolver(); var newChangesetId = _tfsHelper.ShowCheckinDialog(_workspace, pendingChanges, GetWorkItemCheckedInfos(), checkinComment); if (newChangesetId <= 0) throw new GitTfsException("Checkin canceled!"); @@ -88,7 +86,6 @@ namespace Sep.Git.Tfs.Core var workItemInfos = GetWorkItemInfos(options); var checkinNote = _tfsHelper.CreateCheckinNote(options.CheckinNotes); - _tfsHelper.SetPathResolver(); var checkinProblems = _policyEvaluator.EvaluateCheckin(_workspace, pendingChanges, options.CheckinComment, checkinNote, workItemInfos); if (checkinProblems.HasErrors) { From 5b6c81e6657d6a8afebfa962f73abf570f71d775 Mon Sep 17 00:00:00 2001 From: Arkady Shapkin Date: Mon, 14 Apr 2014 22:34:57 +0400 Subject: [PATCH 3/3] Check to install resolver only once --- GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs b/GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs index f200179b..ca21c9ef 100644 --- a/GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs +++ b/GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs @@ -18,12 +18,17 @@ namespace Sep.Git.Tfs.VsCommon { TfsApiBridge _bridge; protected TfsTeamProjectCollection _server; + private static bool _resolverInstalled; public TfsHelperVs2010Base(TextWriter stdout, TfsApiBridge bridge, IContainer container) : base(stdout, bridge, container) { _bridge = bridge; - AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(LoadFromVSFolder); + if (!_resolverInstalled) + { + AppDomain.CurrentDomain.AssemblyResolve += LoadFromVsFolder; + _resolverInstalled = true; + } } public override bool CanGetBranchInformation @@ -224,7 +229,7 @@ namespace Sep.Git.Tfs.VsCommon /// /// Help the TFS client find checkin policy assemblies. /// - Assembly LoadFromVSFolder(object sender, ResolveEventArgs args) + Assembly LoadFromVsFolder(object sender, ResolveEventArgs args) { Trace.WriteLine("Looking for assembly " + args.Name + " ..."); string folderPath = Path.Combine(GetVsInstallDir(), "PrivateAssemblies");