Skip to content

Commit 243dfeb

Browse files
committed
VS2017 integration work
1 parent f6e3e35 commit 243dfeb

8 files changed

Lines changed: 1460 additions & 8 deletions

BidsHelperPackage.cs

Lines changed: 73 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,24 @@ protected override void Initialize()
113113
return;
114114
}
115115

116-
foreach (Type t in Assembly.GetExecutingAssembly().GetTypes())
116+
System.Collections.Generic.List<Exception> pluginExceptions = new System.Collections.Generic.List<Exception>();
117+
Type[] types = null;
118+
try
119+
{
120+
types = Assembly.GetExecutingAssembly().GetTypes();
121+
}
122+
catch (ReflectionTypeLoadException loadEx)
123+
{
124+
types = loadEx.Types; //if some types can't be loaded (possibly because SSIS SSDT isn't installed, just SSAS?) then proceed with the types that work
125+
pluginExceptions.Add(loadEx);
126+
Log.Exception("Problem loading BIDS Helper types list", loadEx);
127+
}
128+
129+
foreach (Type t in types)
117130
{
118131
if (//typeof(IBIDSHelperPlugin).IsAssignableFrom(t.GetType())
119-
t.GetInterfaces().Contains(typeof(IBIDSHelperPlugin))
132+
t != null
133+
&& t.GetInterfaces().Contains(typeof(IBIDSHelperPlugin))
120134
&& (!object.ReferenceEquals(t, typeof(IBIDSHelperPlugin)))
121135
&& (!t.IsAbstract))
122136
{
@@ -134,9 +148,62 @@ protected override void Initialize()
134148
System.Windows.Forms.MessageBox.Show("Problem loading type " + t.Name + ". No constructor found.");
135149
continue;
136150
}
137-
feature = (BIDSHelperPluginBase)con.Invoke(new object[] { this });
138-
Plugins.Add(feature.FullName, feature);
151+
152+
try
153+
{
154+
feature = (BIDSHelperPluginBase)con.Invoke(new object[] { this });
155+
Plugins.Add(feature.FullName, feature);
156+
}
157+
catch (Exception ex)
158+
{
159+
pluginExceptions.Add(new Exception("BIDS Helper plugin constructor failed on " + sAddInTypeName + ": " + ex.Message + "\r\n" + ex.StackTrace, ex));
160+
Log.Exception("BIDS Helper plugin constructor failed on " + sAddInTypeName, ex);
161+
}
162+
}
163+
}
164+
165+
if (pluginExceptions.Count > 0)
166+
{
167+
string sException = "";
168+
foreach (Exception pluginEx in pluginExceptions)
169+
{
170+
sException += string.Format("BIDS Helper encountered an error when Visual Studio started:\r\n{0}\r\n{1}"
171+
, pluginEx.Message
172+
, pluginEx.StackTrace);
173+
174+
Exception innerEx = pluginEx.InnerException;
175+
while (innerEx != null)
176+
{
177+
sException += string.Format("\r\nInner exception:\r\n{0}\r\n{1}"
178+
, innerEx.Message
179+
, innerEx.StackTrace);
180+
innerEx = innerEx.InnerException;
181+
}
182+
183+
ReflectionTypeLoadException ex = pluginEx as ReflectionTypeLoadException;
184+
if (ex == null) ex = pluginEx.InnerException as ReflectionTypeLoadException;
185+
if (ex != null)
186+
{
187+
System.Text.StringBuilder sb = new System.Text.StringBuilder();
188+
foreach (Exception exSub in ex.LoaderExceptions)
189+
{
190+
sb.AppendLine();
191+
sb.AppendLine(exSub.Message);
192+
System.IO.FileNotFoundException exFileNotFound = exSub as System.IO.FileNotFoundException;
193+
if (exFileNotFound != null)
194+
{
195+
if (!string.IsNullOrEmpty(exFileNotFound.FusionLog))
196+
{
197+
sb.AppendLine("Fusion Log:");
198+
sb.AppendLine(exFileNotFound.FusionLog);
199+
}
200+
}
201+
sb.AppendLine();
202+
}
203+
sException += sb.ToString();
204+
}
139205
}
206+
AddInLoadException = new Exception(sException);
140207
}
141208

142209
#if DENALI
@@ -173,7 +240,7 @@ protected override void Initialize()
173240

174241
private bool SwitchVsixManifest()
175242
{
176-
#if SQL2017
243+
#if SQL2017 && !VS2017
177244
string sVersion = VersionInfo.SqlServerVersion.ToString();
178245
if (sVersion.StartsWith("13.")) //this DLL is for SQL 2017 but you have SSDT for SQL2016 installed
179246
{
@@ -220,7 +287,7 @@ private bool SwitchVsixManifest()
220287
throw new Exception("You have SSDT for SQL Server " + VersionInfo.SqlServerFriendlyVersion + " installed but we couldn't find BIDS Helper 2016 files!");
221288
}
222289
}
223-
#elif SQL2016
290+
#elif SQL2016 && !VS2017
224291
string sVersion = VersionInfo.SqlServerVersion.ToString();
225292
if (sVersion.StartsWith("14.")) //this DLL is for SQL 2016 but you have SSDT for SQL2017 installed
226293
{

Core/Options/BIDSHelperOptionsVersionCheckPage.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,18 @@ private void BIDSHelperOptionsVersionCheckPage_Load(object sender, EventArgs e)
5757
, BIDSHelperPackage.AddInLoadException.Message
5858
, BIDSHelperPackage.AddInLoadException.StackTrace);
5959

60+
Exception innerEx = BIDSHelperPackage.AddInLoadException.InnerException;
61+
while (innerEx != null)
62+
{
63+
this.lblBidsHelperLoadException.Text += string.Format("\r\nInner exception:\r\n{0}\r\n{1}"
64+
, innerEx.Message
65+
, innerEx.StackTrace);
66+
innerEx = innerEx.InnerException;
67+
}
68+
6069
ReflectionTypeLoadException ex = BIDSHelperPackage.AddInLoadException as ReflectionTypeLoadException;
70+
if (ex == null) ex = BIDSHelperPackage.AddInLoadException.InnerException as ReflectionTypeLoadException;
71+
if (ex == null && BIDSHelperPackage.AddInLoadException.InnerException != null) ex = BIDSHelperPackage.AddInLoadException.InnerException.InnerException as ReflectionTypeLoadException;
6172
if (ex != null)
6273
{
6374
System.Text.StringBuilder sb = new System.Text.StringBuilder();

DLLs/SQL2017/msddsp.dll

146 KB
Binary file not shown.
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<root>
3+
<!--
4+
Microsoft ResX Schema
5+
6+
Version 2.0
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
11+
associated with the data types.
12+
13+
Example:
14+
15+
... ado.net/XML headers & schema ...
16+
<resheader name="resmimetype">text/microsoft-resx</resheader>
17+
<resheader name="version">2.0</resheader>
18+
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19+
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20+
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21+
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22+
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23+
<value>[base64 mime encoded serialized .NET Framework object]</value>
24+
</data>
25+
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26+
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27+
<comment>This is a comment</comment>
28+
</data>
29+
30+
There are any number of "resheader" rows that contain simple
31+
name/value pairs.
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
37+
mimetype set.
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
41+
extensible. For a given mimetype the value must be set accordingly:
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
45+
read any of the formats listed below.
46+
47+
mimetype: application/x-microsoft.net.object.binary.base64
48+
value : The object must be serialized with
49+
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50+
: and then encoded with base64 encoding.
51+
52+
mimetype: application/x-microsoft.net.object.soap.base64
53+
value : The object must be serialized with
54+
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55+
: and then encoded with base64 encoding.
56+
57+
mimetype: application/x-microsoft.net.object.bytearray.base64
58+
value : The object must be serialized into a byte array
59+
: using a System.ComponentModel.TypeConverter
60+
: and then encoded with base64 encoding.
61+
-->
62+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63+
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64+
<xsd:element name="root" msdata:IsDataSet="true">
65+
<xsd:complexType>
66+
<xsd:choice maxOccurs="unbounded">
67+
<xsd:element name="metadata">
68+
<xsd:complexType>
69+
<xsd:sequence>
70+
<xsd:element name="value" type="xsd:string" minOccurs="0" />
71+
</xsd:sequence>
72+
<xsd:attribute name="name" use="required" type="xsd:string" />
73+
<xsd:attribute name="type" type="xsd:string" />
74+
<xsd:attribute name="mimetype" type="xsd:string" />
75+
<xsd:attribute ref="xml:space" />
76+
</xsd:complexType>
77+
</xsd:element>
78+
<xsd:element name="assembly">
79+
<xsd:complexType>
80+
<xsd:attribute name="alias" type="xsd:string" />
81+
<xsd:attribute name="name" type="xsd:string" />
82+
</xsd:complexType>
83+
</xsd:element>
84+
<xsd:element name="data">
85+
<xsd:complexType>
86+
<xsd:sequence>
87+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88+
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89+
</xsd:sequence>
90+
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91+
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92+
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93+
<xsd:attribute ref="xml:space" />
94+
</xsd:complexType>
95+
</xsd:element>
96+
<xsd:element name="resheader">
97+
<xsd:complexType>
98+
<xsd:sequence>
99+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100+
</xsd:sequence>
101+
<xsd:attribute name="name" type="xsd:string" use="required" />
102+
</xsd:complexType>
103+
</xsd:element>
104+
</xsd:choice>
105+
</xsd:complexType>
106+
</xsd:element>
107+
</xsd:schema>
108+
<resheader name="resmimetype">
109+
<value>text/microsoft-resx</value>
110+
</resheader>
111+
<resheader name="version">
112+
<value>2.0</value>
113+
</resheader>
114+
<resheader name="reader">
115+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116+
</resheader>
117+
<resheader name="writer">
118+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119+
</resheader>
120+
<data name="110" xml:space="preserve">
121+
<value>BIDS Helper 2017 Extension</value>
122+
</data>
123+
<data name="112" xml:space="preserve">
124+
<value>BIDS Helper 2017 Visual Studio Extension v2.0.2 - An add-in to extend SQL Server Data Tools</value>
125+
</data>
126+
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
127+
<data name="400" type="System.Resources.ResXFileRef, System.Windows.Forms">
128+
<value>..\..\Resources\BidsHelper.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
129+
</data>
130+
<data name="deploymdxscript" type="System.Resources.ResXFileRef, System.Windows.Forms">
131+
<value>..\..\Resources\deploymdxscript.xslt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
132+
</data>
133+
<data name="HelpAboutText" type="System.Resources.ResXFileRef, System.Windows.Forms">
134+
<value>..\..\helpabouttext.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
135+
</data>
136+
</root>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<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">
3+
<Metadata>
4+
<Identity Id="BIDSHelper_VSIX.b6deed2d-6c6f-46d4-94be-28027bf7d873" Version="2.0.2" Language="en-US" Publisher="BIDSHelper.codeplex.com" />
5+
<DisplayName>BIDS Helper for Visual Studio 2017</DisplayName>
6+
<Description xml:space="preserve">BIDS Helper is an extension for BIDS / SSDT-BI that includes numerous enhancements for SQL Server BI projects</Description>
7+
<MoreInfo>https://bidshelper.codeplex.com/documentation</MoreInfo>
8+
<License>License.rtf</License>
9+
<Icon>BIDSHelper.ico</Icon>
10+
<PreviewImage>BIDSHelperMontage.gif</PreviewImage>
11+
<Tags>SSDT,SSIS,SSAS,SSRS,BIDS,SQL Server Data Tools,Integration Services,Analysis Services,Reporting Services</Tags>
12+
</Metadata>
13+
<Installation>
14+
<InstallationTarget Id="Microsoft.VisualStudio.IntegratedShell" Version="15.0" />
15+
</Installation>
16+
<Dependencies>
17+
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
18+
<Dependency Id="Microsoft.VisualStudio.MPF.11.0" DisplayName="Visual Studio MPF 11.0" d:Source="Installed" Version="[11.0,12.0)" />
19+
</Dependencies>
20+
<Assets>
21+
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
22+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" />
23+
</Assets>
24+
</PackageManifest>

0 commit comments

Comments
 (0)