Skip to content

Commit 471af0d

Browse files
author
Greg Galloway
committed
2.4.0 release
1 parent eb3e7ad commit 471af0d

20 files changed

Lines changed: 229 additions & 57 deletions

BidsHelperPackage.cs

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,29 @@
1717
using BIDSHelper.Core.Logger;
1818
using Task = System.Threading.Tasks.Task;
1919

20+
using System.Runtime.CompilerServices;
21+
using System.Runtime.InteropServices;
22+
23+
namespace mscoree
24+
{
25+
[CompilerGenerated]
26+
[Guid("CB2F6722-AB3A-11D2-9C40-00C04FA30A3E")]
27+
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
28+
[TypeIdentifier]
29+
[ComImport]
30+
[CLSCompliant(false)]
31+
public interface ICorRuntimeHost
32+
{
33+
void _VtblGap1_11();
34+
35+
void EnumDomains(out IntPtr enumHandle);
36+
37+
void NextDomain([In] IntPtr enumHandle, [MarshalAs(UnmanagedType.IUnknown)] out object appDomain);
38+
39+
void CloseEnum([In] IntPtr enumHandle);
40+
}
41+
}
42+
2043
namespace BIDSHelper
2144
{
2245

@@ -686,6 +709,45 @@ System.Reflection.Assembly currentDomain_AssemblyResolve(object sender, ResolveE
686709
string _recursiveAssemblyResolveNameToSkip = null;
687710
System.Collections.Generic.List<string> _assemblyLoadsFailed = new System.Collections.Generic.List<string>();
688711
System.Collections.Generic.List<System.ResolveEventHandler> _microsoftEventHandlersToIgnoreErrors = new System.Collections.Generic.List<ResolveEventHandler>();
712+
AppDomain _defaultAppDomain = null;
713+
714+
private static mscoree.ICorRuntimeHost GetCorRuntimeHost()
715+
{
716+
return (mscoree.ICorRuntimeHost)Activator.CreateInstance(Marshal.GetTypeFromCLSID(new Guid("CB2F6723-AB3A-11D2-9C40-00C04FA30A3E")));
717+
}
718+
719+
public AppDomain GetDefaultAppDomain()
720+
{
721+
IntPtr enumHandle = IntPtr.Zero;
722+
mscoree.ICorRuntimeHost host = GetCorRuntimeHost();
723+
try
724+
{
725+
host.EnumDomains(out enumHandle);
726+
727+
object domain = null;
728+
while (true)
729+
{
730+
host.NextDomain(enumHandle, out domain);
731+
732+
if (domain == null) break;
733+
734+
AppDomain appDomain = (AppDomain)domain;
735+
if (appDomain.IsDefaultAppDomain())
736+
return appDomain;
737+
}
738+
return null;
739+
}
740+
catch (Exception e)
741+
{
742+
Log.Debug("Caught error in Microsoft AssemblyResolve and skipped: " + e.Message);
743+
return null;
744+
}
745+
finally
746+
{
747+
host.CloseEnum(enumHandle);
748+
Marshal.ReleaseComObject(host);
749+
}
750+
}
689751

690752
/// <summary>
691753
/// Only fires if an assembly fails to load. This gives us a chance to redirect to a DLL that does exist.
@@ -732,9 +794,22 @@ System.Reflection.Assembly currentDomain_AssemblyResolve(object sender, ResolveE
732794
{
733795
if (loadedAlready.GetName().Name == assemblyname.Name
734796
&& loadedAlready.GetName().Version.Major == assemblyname.Version.Major)
797+
//&& loadedAlready.GetName().Version.Minor == assemblyname.Version.Minor
798+
//&& loadedAlready.GetName().Version.MinorRevision == assemblyname.Version.MinorRevision)
735799
return loadedAlready;
736800
}
737801

802+
//if (_defaultAppDomain == null)
803+
// _defaultAppDomain = GetDefaultAppDomain();
804+
//foreach (Assembly loadedAlready in _defaultAppDomain.GetAssemblies())
805+
//{
806+
// if (loadedAlready.GetName().Name == assemblyname.Name
807+
// && loadedAlready.GetName().Version.Major == assemblyname.Version.Major
808+
// && loadedAlready.GetName().Version.Minor == assemblyname.Version.Minor
809+
// && loadedAlready.GetName().Version.MinorRevision == assemblyname.Version.MinorRevision)
810+
// return loadedAlready;
811+
//}
812+
738813
System.Collections.Generic.List<string> pathsToCheck = new System.Collections.Generic.List<string>();
739814
var bidsHelperPath = new System.IO.FileInfo(typeof(BIDSHelperPackage).Assembly.Location);
740815
pathsToCheck.Add(bidsHelperPath.DirectoryName + "\\");

Core/VersionInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class VersionInfo
99
{
1010
// BIDS Helper Assembly & VSIX Version
1111
// N.B. Manually update the manifest file, if you change this - See source.extension.vsixmanifest
12-
public const string Version = "2.3.9";
12+
public const string Version = "2.4.0";
1313

1414
private static readonly object lockResource = new object();
1515
private static Version visualStudioVersion;

Manifest/SQL2017/VSPackageVS2017.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<value>BI Developer Extensions for Visual Studio 2017</value>
122122
</data>
123123
<data name="112" xml:space="preserve">
124-
<value>BI Developer Extensions v2.3.9 for Visual Studio 2017 - An add-in to extend SQL Server Data Tools</value>
124+
<value>BI Developer Extensions v2.4.0 for Visual Studio 2017 - An add-in to extend SQL Server Data Tools</value>
125125
</data>
126126
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
127127
<data name="400" type="System.Resources.ResXFileRef, System.Windows.Forms">

Manifest/SQL2017/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="BIDSHelper_VSIX.b6deed2d-6c6f-46d4-94be-28027bf7d873" Version="2.3.9" Language="en-US" Publisher="bideveloperextensions.github.io" />
4+
<Identity Id="BIDSHelper_VSIX.b6deed2d-6c6f-46d4-94be-28027bf7d873" Version="2.4.0" Language="en-US" Publisher="bideveloperextensions.github.io" />
55
<DisplayName>BI Developer Extensions for Visual Studio 2017</DisplayName>
66
<Description xml:space="preserve">BI Developer Extensions (formerly BIDS Helper) is an extension for BIDS / SSDT that includes numerous enhancements for SQL Server BI projects</Description>
77
<MoreInfo>https://bideveloperextensions.github.io</MoreInfo>

Manifest/SQL2019/VSPackageVS2019.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<value>BI Developer Extensions for Visual Studio 2019</value>
122122
</data>
123123
<data name="112" xml:space="preserve">
124-
<value>BI Developer Extensions v2.3.9 for Visual Studio 2019 - An add-in to extend SQL Server Data Tools</value>
124+
<value>BI Developer Extensions v2.4.0 for Visual Studio 2019 - An add-in to extend SQL Server Data Tools</value>
125125
</data>
126126
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
127127
<data name="400" type="System.Resources.ResXFileRef, System.Windows.Forms">

Manifest/SQL2019/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="BIDSHelper_VSIX.b6deed2d-6c6f-46d4-94be-28027bf7d874" Version="2.3.9" Language="en-US" Publisher="bideveloperextensions.github.io" />
4+
<Identity Id="BIDSHelper_VSIX.b6deed2d-6c6f-46d4-94be-28027bf7d874" Version="2.4.0" Language="en-US" Publisher="bideveloperextensions.github.io" />
55
<DisplayName>BI Developer Extensions for Visual Studio 2019</DisplayName>
66
<Description xml:space="preserve">BI Developer Extensions (formerly BIDS Helper) is an extension for BIDS / SSDT that includes numerous enhancements for SQL Server BI projects</Description>
77
<MoreInfo>https://bideveloperextensions.github.io</MoreInfo>

SQL2019_VS2017_BidsHelper.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,8 +1167,9 @@
11671167
</Target>
11681168
-->
11691169
<PropertyGroup>
1170-
<PostBuildEvent>
1171-
</PostBuildEvent>
1170+
<PostBuildEvent>copy "C:\projects\BIDS Helper\GitHub\bideveloperextensions2\bin\Debug\BidsHelper2019.dll" "C:\Users\ggalloway\AppData\Local\Microsoft\VisualStudio\15.0_849621d1Exp\Extensions\yh2cp5be.3c3"
1171+
copy "C:\projects\BIDS Helper\GitHub\bideveloperextensions2\bin\Debug\BidsHelper2019.pdb" "C:\Users\ggalloway\AppData\Local\Microsoft\VisualStudio\15.0_849621d1Exp\Extensions\yh2cp5be.3c3"
1172+
</PostBuildEvent>
11721173
</PropertyGroup>
11731174
<PropertyGroup Label="VsixCompress">
11741175
<VsixCompressTargets Condition=" '$(VsixCompressTargets)'=='' ">$([System.IO.Path]::GetFullPath( $(MSBuildProjectDirectory)\.\packages\VsixCompress.1.0.1\tools\vsix-compress.targets ))</VsixCompressTargets>

SSAS/CalcHelpersPlugin.cs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#if SQL2019
22
extern alias asAlias;
33
extern alias sharedDataWarehouseInterfaces;
4+
extern alias asDataWarehouseInterfaces;
45
using asAlias::Microsoft.DataWarehouse.Design;
56
using asAlias::Microsoft.DataWarehouse.Controls;
67
using sharedDataWarehouseInterfaces::Microsoft.DataWarehouse.Design;
@@ -308,14 +309,30 @@ void OpenCalcPropertiesDialog()
308309
System.IServiceProvider provider = (System.IServiceProvider)this.ApplicationObject.ActiveWindow.ProjectItem.ContainingProject;
309310
using (WaitCursor cursor1 = new WaitCursor())
310311
{
311-
IUserPromptService oService = (IUserPromptService)provider.GetService(typeof(IUserPromptService));
312+
try
313+
{
314+
IUserPromptService oService = (IUserPromptService)provider.GetService(typeof(IUserPromptService));
312315

313-
foreach (Type t in System.Reflection.Assembly.GetAssembly(typeof(Scripts)).GetTypes())
316+
foreach (Type t in System.Reflection.Assembly.GetAssembly(typeof(Scripts)).GetTypes())
317+
{
318+
if (t.FullName == "Microsoft.AnalysisServices.Design.Calculations.CalcPropertiesEditorForm")
319+
{
320+
form1 = (Form)t.GetConstructor(new Type[] { typeof(IUserPromptService) }).Invoke(new object[] { oService });
321+
break;
322+
}
323+
}
324+
}
325+
catch (Exception ex)
314326
{
315-
if (t.FullName == "Microsoft.AnalysisServices.Design.Calculations.CalcPropertiesEditorForm")
327+
asDataWarehouseInterfaces::Microsoft.DataWarehouse.Design.IUserPromptService oService = (asDataWarehouseInterfaces::Microsoft.DataWarehouse.Design.IUserPromptService)provider.GetService(typeof(asDataWarehouseInterfaces::Microsoft.DataWarehouse.Design.IUserPromptService));
328+
329+
foreach (Type t in System.Reflection.Assembly.GetAssembly(typeof(Scripts)).GetTypes())
316330
{
317-
form1 = (Form)t.GetConstructor(new Type[] { typeof(IUserPromptService) }).Invoke(new object[] { oService });
318-
break;
331+
if (t.FullName == "Microsoft.AnalysisServices.Design.Calculations.CalcPropertiesEditorForm")
332+
{
333+
form1 = (Form)t.GetConstructor(new Type[] { typeof(asDataWarehouseInterfaces::Microsoft.DataWarehouse.Design.IUserPromptService) }).Invoke(new object[] { oService });
334+
break;
335+
}
319336
}
320337
}
321338
if (form1 == null) throw new Exception("Couldn't create instance of CalcPropertiesEditorForm");

SSAS/DeploymentSettings.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
extern alias sharedDataWarehouseInterfaces;
2+
extern alias asDataWarehouseInterfaces;
23
using System;
34
using System.Xml;
45
//using Extensibility;
@@ -54,7 +55,9 @@ void PopulateDeploymentSettings(Project project)
5455
object oService = null;
5556
if (project is System.IServiceProvider) //Multidimensional
5657
{
57-
oService = typeof(System.IServiceProvider).InvokeMember("GetService", flags, null, project, new object[] { typeof(IConfigurationSettings) });
58+
oService = project.GetIConfigurationSettings();
59+
if (oService == null) throw new Exception("Could not GetService IConfigurationSettings in project from " + project.GetType().Assembly.Location);
60+
5861
string sTargetServer = (string)oService.GetType().InvokeMember("GetSetting", flags, null, oService, new object[] { "TargetServer" });
5962
if (!String.IsNullOrEmpty(sTargetServer)) mTargetServer = sTargetServer;
6063
string sTargetDatabase = (string)oService.GetType().InvokeMember("GetSetting", flags, null, oService, new object[] { "TargetDatabase" });

SSAS/PCDimNaturalizer/PCDimNaturalizerPlugin.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ private void ExecDimension(ProjectItem pi)
178178
Program.SQLFlattener = null;
179179

180180
asAlias::Microsoft.DataWarehouse.VsIntegration.Shell.Project.IFileProjectHierarchy projectService = (asAlias::Microsoft.DataWarehouse.VsIntegration.Shell.Project.IFileProjectHierarchy)((System.IServiceProvider)pi.ContainingProject).GetService(typeof(asAlias::Microsoft.DataWarehouse.VsIntegration.Shell.Project.IFileProjectHierarchy));
181-
sharedDataWarehouseInterfaces::Microsoft.DataWarehouse.Interfaces.IConfigurationSettings settings = (sharedDataWarehouseInterfaces::Microsoft.DataWarehouse.Interfaces.IConfigurationSettings)((System.IServiceProvider)pi.ContainingProject).GetService(typeof(sharedDataWarehouseInterfaces::Microsoft.DataWarehouse.Interfaces.IConfigurationSettings));
181+
object settings = pi.ContainingProject.GetIConfigurationSettings();
182+
if (settings == null) throw new Exception("Could not GetService IConfigurationSettings in project from " + pi.ContainingProject.GetType().Assembly.Location);
183+
182184
asAlias::Microsoft.DataWarehouse.Project.DataWarehouseProjectManager projectManager = (asAlias::Microsoft.DataWarehouse.Project.DataWarehouseProjectManager)settings.GetType().InvokeMember("ProjectManager", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.FlattenHierarchy, null, settings, null);
183185

184186
Dimension dimNew = dim.Clone();

0 commit comments

Comments
 (0)