From 5355bd183ca97d63b0210b320e1adfed6eecdd6d Mon Sep 17 00:00:00 2001 From: furmangg_cp Date: Mon, 3 Jul 2017 15:24:26 +0000 Subject: [PATCH] fixing issue launching BIDS Helper VS2015 older versions --- BidsHelperPackage.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/BidsHelperPackage.cs b/BidsHelperPackage.cs index cea62fb..cbc207a 100644 --- a/BidsHelperPackage.cs +++ b/BidsHelperPackage.cs @@ -276,8 +276,11 @@ private bool SwitchVsixManifest() //it looks like some earlier versions of VS2015 use the registry while newer versions of VS2015 (like Update 3) just use the vsixmanifest and pkgdef files? Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio\14.0_Config\Packages\{" + PackageGuidString +"}", true); - regKey.SetValue("CodeBase", sDll2016Path, Microsoft.Win32.RegistryValueKind.String); - regKey.Close(); + if (regKey != null) + { + regKey.SetValue("CodeBase", sDll2016Path, Microsoft.Win32.RegistryValueKind.String); + regKey.Close(); + } System.Windows.Forms.MessageBox.Show("You have SSDT for SQL Server " + VersionInfo.SqlServerFriendlyVersion + " installed. Please restart Visual Studio so BIDS Helper can reconfigure itself to work properly with that version of SSDT.", "BIDS Helper"); return true; @@ -323,8 +326,11 @@ private bool SwitchVsixManifest() //it looks like some earlier versions of VS2015 use the registry while newer versions of VS2015 (like Update 3) just use the vsixmanifest and pkgdef files? Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio\14.0_Config\Packages\{" + PackageGuidString +"}", true); - regKey.SetValue("CodeBase", sDll2017Path, Microsoft.Win32.RegistryValueKind.String); - regKey.Close(); + if (regKey != null) + { + regKey.SetValue("CodeBase", sDll2017Path, Microsoft.Win32.RegistryValueKind.String); + regKey.Close(); + } System.Windows.Forms.MessageBox.Show("You have SSDT for SQL Server " + VersionInfo.SqlServerFriendlyVersion + " installed. Please restart Visual Studio so BIDS Helper can reconfigure itself to work properly with that version of SSDT.", "BIDS Helper"); return true;