@@ -146,25 +146,30 @@ Microsoft Analysis Services Projects (by Microsoft) v2.8.11 04a86fc2-dbd5-4222-8
146146 try
147147 {
148148 Microsoft . VisualStudio . ExtensionManager . IExtensionHeader h = i . Header ;
149- if ( ! h . SystemComponent )
149+ if ( h . Name == "Microsoft Reporting Services Projects" || string . Compare ( h . Identifier , "717ad572-c4b7-435c-c166-c2969777f718" , true ) == 0 )
150150 {
151- if ( h . Name == "Microsoft Reporting Services Projects" || string . Compare ( h . Identifier , "717ad572-c4b7-435c-c166-c2969777f718" , true ) == 0 )
152- {
153- SSRSExtensionVersion = h . Version ;
154- Log . Debug ( "SSRS extension v" + h . Version + " is installed" ) ;
155- }
156- else if ( h . Name == "Microsoft Integration Services Projects" || string . Compare ( h . Identifier , "D1B09713-C12E-43CC-9EF4-6562298285AB" , true ) == 0 )
157- {
158- SSISExtensionVersion = h . Version ;
159- Log . Debug ( "SSIS extension v" + h . Version + " is installed" ) ;
160- }
161- else if ( h . Name == "Microsoft Analysis Services Projects" || string . Compare ( h . Identifier , "04a86fc2-dbd5-4222-848e-911638e487fe" , true ) == 0 )
162- {
163- SSASExtensionVersion = h . Version ;
164- Log . Debug ( "SSAS extension v" + h . Version + " is installed" ) ;
165- }
166- result += h . Name + " (by " + h . Author + ") v" + h . Version + " " + h . Identifier + " " + h . MoreInfoUrl + System . Environment . NewLine ;
151+ SSRSExtensionVersion = h . Version ;
152+ SSRSExtensionInstallPath = i . InstallPath ;
153+ Log . Debug ( "SSRS extension v" + h . Version + " is installed at " + i . InstallPath ) ;
154+ }
155+ else if ( h . Name == "Microsoft Integration Services Projects" || string . Compare ( h . Identifier , "D1B09713-C12E-43CC-9EF4-6562298285AB" , true ) == 0 )
156+ {
157+ SSISExtensionVersion = h . Version ;
158+ SSISExtensionInstallPath = i . InstallPath ;
159+ Log . Debug ( "SSIS extension v" + h . Version + " is installed at " + i . InstallPath ) ;
160+ }
161+ else if ( h . Name == "Microsoft Analysis Services Projects" || string . Compare ( h . Identifier , "04a86fc2-dbd5-4222-848e-911638e487fe" , true ) == 0 )
162+ {
163+ SSASExtensionVersion = h . Version ;
164+ SSASExtensionInstallPath = i . InstallPath ;
165+ Log . Debug ( "SSAS extension v" + h . Version + " is installed at " + i . InstallPath ) ;
166+ }
167+ else if ( h . Name == "Microsoft BI Shared Components for Visual Studio" || string . Compare ( h . Identifier , "BAB64743-DA65-4501-B3A3-A73171C73D77" , true ) == 0 )
168+ {
169+ BISharedExtensionInstallPath = i . InstallPath ;
170+ Log . Debug ( "BI Shared extension v" + h . Version + " is installed at " + i . InstallPath ) ;
167171 }
172+ result += h . Name + " (by " + h . Author + ") v" + h . Version + " " + h . Identifier + " " + h . MoreInfoUrl + " " + i . InstallPath + System . Environment . NewLine ;
168173 }
169174 catch { }
170175 }
@@ -662,39 +667,63 @@ System.Reflection.Assembly currentDomain_AssemblyResolve(object sender, ResolveE
662667 System . Diagnostics . Debug . WriteLine ( "AssemblyResolve: " + args . Name ) ;
663668 DateTime dtStart = DateTime . Now ;
664669 if (
665- args . Name . StartsWith ( "Microsoft.AnalysisServices. " )
670+ args . Name . StartsWith ( "Microsoft.AnalysisServices" )
666671 || args . Name . ToLower ( ) . StartsWith ( "microsoft.sqlserver." )
667672 || args . Name . StartsWith ( "Microsoft.ReportViewer." )
668- || args . Name . StartsWith ( "Microsoft.DataWarehouse. " )
673+ || args . Name . StartsWith ( "Microsoft.DataWarehouse" )
669674 || args . Name . StartsWith ( "Microsoft.DataTransformationServices." )
670675 )
671676 {
672677 var assemblyname = new AssemblyName ( args . Name ) ;
673- Version originalVersion = ( Version ) assemblyname . Version . Clone ( ) ;
674- for ( int i = 0 ; i < 500 ; i ++ )
678+ System . Collections . Generic . List < string > pathsToCheck = new System . Collections . Generic . List < string > ( ) ;
679+ var bidsHelperPath = new System . IO . FileInfo ( typeof ( BIDSHelperPackage ) . Assembly . Location ) ;
680+ pathsToCheck . Add ( bidsHelperPath . DirectoryName + "\\ " ) ;
681+ if ( SSASExtensionInstallPath != null ) pathsToCheck . Add ( SSASExtensionInstallPath ) ;
682+ if ( SSISExtensionInstallPath != null ) pathsToCheck . Add ( SSISExtensionInstallPath ) ;
683+ if ( SSRSExtensionInstallPath != null ) pathsToCheck . Add ( SSRSExtensionInstallPath ) ;
684+ if ( BISharedExtensionInstallPath != null ) pathsToCheck . Add ( BISharedExtensionInstallPath ) ;
685+ foreach ( string extensionfolder in pathsToCheck )
675686 {
676- assemblyname . Version = new Version ( originalVersion . Major , i , 0 , 0 ) ;
677- string sAssemblyName = assemblyname . ToString ( ) ;
678- if ( _assemblyLoadsFailed . Contains ( sAssemblyName ) ) continue ;
679- try
687+ string sPath = extensionfolder + assemblyname . Name + ".dll" ;
688+ if ( System . IO . File . Exists ( sPath ) )
680689 {
681- _recursiveAssemblyResolveNameToSkip = sAssemblyName ;
682- var assembly = Assembly . Load ( assemblyname ) ;
683- System . Diagnostics . Debug . WriteLine ( "AssemblyResolveSuccess: " + args . Name + " to " + assemblyname . Version + " in " + DateTime . Now . Subtract ( dtStart ) . TotalMilliseconds + "ms" ) ;
690+ var assembly = Assembly . LoadFile ( sPath ) ;
691+ System . Diagnostics . Debug . WriteLine ( "AssemblyResolveSuccess: " + args . Name + " to version " + assembly . GetName ( ) . Version . ToString ( ) + " at " + sPath + " in " + DateTime . Now . Subtract ( dtStart ) . TotalMilliseconds + "ms" ) ;
684692 return assembly ;
685693 }
686- catch
687- {
688- if ( ! _assemblyLoadsFailed . Contains ( sAssemblyName ) )
689- _assemblyLoadsFailed . Add ( sAssemblyName ) ;
690- }
691- finally
692- {
693- _recursiveAssemblyResolveNameToSkip = null ;
694- }
695694 }
696695 System . Diagnostics . Debug . WriteLine ( "AssemblyResolveFail: " + args . Name + " in " + DateTime . Now . Subtract ( dtStart ) . TotalMilliseconds + "ms" ) ;
697696 return null ;
697+
698+ //Version originalVersion = (Version)assemblyname.Version.Clone();
699+ //for (int i = 0; i < 500; i++)
700+ //{
701+ // for (int j = 0; j <= (i >= originalVersion.Minor && i <= originalVersion.Minor + 10 ? 5 : 0); j++)
702+ // {
703+ // assemblyname.Version = new Version(originalVersion.Major, i, j, 0);
704+ // string sAssemblyName = assemblyname.ToString();
705+ // if (_assemblyLoadsFailed.Contains(sAssemblyName)) continue;
706+ // try
707+ // {
708+ // _recursiveAssemblyResolveNameToSkip = sAssemblyName;
709+ // var assembly = Assembly.Load(assemblyname);
710+ // System.Diagnostics.Debug.WriteLine("AssemblyResolveSuccess: " + args.Name + " to " + assemblyname.Version + " in " + DateTime.Now.Subtract(dtStart).TotalMilliseconds + "ms");
711+ // return assembly;
712+ // }
713+ // catch
714+ // {
715+ // if (!_assemblyLoadsFailed.Contains(sAssemblyName))
716+ // _assemblyLoadsFailed.Add(sAssemblyName);
717+ // System.Diagnostics.Debug.WriteLine("AssemblyResolveTried: " + args.Name + " to " + assemblyname.Version + " in " + DateTime.Now.Subtract(dtStart).TotalMilliseconds + "ms");
718+ // }
719+ // finally
720+ // {
721+ // _recursiveAssemblyResolveNameToSkip = null;
722+ // }
723+ // }
724+ //}
725+ //System.Diagnostics.Debug.WriteLine("AssemblyResolveFail: " + args.Name + " in " + DateTime.Now.Subtract(dtStart).TotalMilliseconds + "ms");
726+ //return null;
698727 }
699728 else
700729 {
@@ -737,6 +766,10 @@ public int OnModeChange(DBGMODE mode)
737766 public static Version SSISExtensionVersion = null ;
738767 public static Version SSASExtensionVersion = null ;
739768 public static Version SSRSExtensionVersion = null ;
769+ public static string SSISExtensionInstallPath = null ;
770+ public static string SSASExtensionInstallPath = null ;
771+ public static string SSRSExtensionInstallPath = null ;
772+ public static string BISharedExtensionInstallPath = null ;
740773
741774 internal System . IServiceProvider ServiceProvider { get { return ( System . IServiceProvider ) this ; } }
742775
0 commit comments