Skip to content

Commit

Permalink
SSMS 19 Compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
akarzazi committed Feb 26, 2023
1 parent d500cec commit c8f0eac
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 13 deletions.
2 changes: 1 addition & 1 deletion PublishRelease.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Vsix install does not work, see
https://docs.microsoft.com/en-us/sql/ssms/install-extensions-in-sql-server-management-studio-ssms?view=sql-server-ver15

# Publish workaround
Zip the extension folder in `C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Extensions\SSMSPlus` as SFX package
Zip the extension folder in `C:\Program Files (x86)\Microsoft SQL Server Management Studio 19\Common7\IDE\Extensions\SSMSPlus` as SFX package
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SSMSPlus
SSMS Plus is a productivity extension for SQL Server Management Studio 18.
SSMS Plus is a productivity extension for SQL Server Management Studio 18 / 19.

It extends SSMS with a handful set of features:

Expand Down Expand Up @@ -33,21 +33,28 @@ It extends SSMS with a handful set of features:

# Getting started
## Prerequisites
SQL Server Management Studio 18
SQL Server Management Studio 18 / 19

## Download
Grab the latest build archive from the [Releases](https://github.com/akarzazi/SSMSPlus/releases) page.
### For SSMS 19

Get the latest build from the [Releases](https://github.com/akarzazi/SSMSPlus/releases) page.

### For SSMS 18

Get this release:
https://github.com/akarzazi/SSMSPlus/releases/tag/4.0

## Install

> SQL Server Management Studio extensions cannot be installed via VSIX Installer under SSMS 18.x. See
> SQL Server Management Studio extensions cannot be installed via VSIX Installer under SSMS 19.x. See
> https://docs.microsoft.com/en-us/sql/ssms/install-extensions-in-sql-server-management-studio-ssms?view=sql-server-ver15|
The release is an SFX package, extract the archive content to the SSMS install location.

On the extract dialog, fill the path of the extensions directory.

`C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Extensions`
`C:\Program Files (x86)\Microsoft SQL Server Management Studio 19\Common7\IDE\Extensions`

![SSMS Plus Extension dlls](docs/illustrations/install-sfx-extract.png?raw=true "SSMS Plus Extension dlls")

Expand All @@ -62,7 +69,7 @@ Close SQL Server Management Studio.

Delete the SSMSPlus extension directory:

`C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Extensions\SSMSPlus`
`C:\Program Files (x86)\Microsoft SQL Server Management Studio 19\Common7\IDE\Extensions\SSMSPlus`

Follow the install steps.

Expand Down Expand Up @@ -130,13 +137,13 @@ This section explains how to setup Visual Studio to debug the plugin within an S

1. In the Debug section of the main project "SSMSPlus", setup your SSMS path as the startup program.

`C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe`
`C:\Program Files (x86)\Microsoft SQL Server Management Studio 19\Common7\IDE\Ssms.exe`

![SSMS Plus Debug Startup](docs/illustrations/debug-vs-startup.png?raw=true "Documents Export")

2. In the VSIX section of the main project "SSMSPlus", configure the deployment path for the plugin.

`C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Extensions\SSMSPlus`
`C:\Program Files (x86)\Microsoft SQL Server Management Studio 19\Common7\IDE\Extensions\SSMSPlus`
![SSMS Plus Documents Export](docs/illustrations/debug-vs-copy-vsix.png?raw=true "Documents Export")

3. That's All ! You may start your the debugging session.
Expand Down
2 changes: 1 addition & 1 deletion src/SSMSPlus/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.4.0")]
[assembly: AssemblyVersion("0.0.5.0")]
[assembly: AssemblyFileVersion("0.0.0.1")]
4 changes: 2 additions & 2 deletions src/SSMSPlus/SSMSPlus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CopyVsixExtensionFiles>True</CopyVsixExtensionFiles>
<CopyVsixExtensionLocation>C:\Program Files %28x86%29\Microsoft SQL Server Management Studio 18\Common7\IDE\Extensions\SSMSPlus</CopyVsixExtensionLocation>
<CopyVsixExtensionLocation>C:\Program Files %28x86%29\Microsoft SQL Server Management Studio 19\Common7\IDE\Extensions\SSMSPlus</CopyVsixExtensionLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -61,7 +61,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CopyVsixExtensionFiles>True</CopyVsixExtensionFiles>
<CopyVsixExtensionLocation>C:\Program Files %28x86%29\Microsoft SQL Server Management Studio 18\Common7\IDE\Extensions\SSMSPlus</CopyVsixExtensionLocation>
<CopyVsixExtensionLocation>C:\Program Files %28x86%29\Microsoft SQL Server Management Studio 19\Common7\IDE\Extensions\SSMSPlus</CopyVsixExtensionLocation>
</PropertyGroup>
<ItemGroup>
<Compile Include="Command1.cs" />
Expand Down
Binary file modified src/SSMSPlus/assemblies/Microsoft.SqlServer.ConnectionInfo.dll
Binary file not shown.
Binary file modified src/SSMSPlus/assemblies/Microsoft.SqlServer.RegSvrEnum.dll
Binary file not shown.
Binary file modified src/SSMSPlus/assemblies/SqlPackageBase.dll
Binary file not shown.
Binary file modified src/SSMSPlus/assemblies/SqlWorkbench.Interfaces.dll
Binary file not shown.
28 changes: 27 additions & 1 deletion src/SSMSPlusCore/Integration/Connection/DbConnectionString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Text.RegularExpressions;

public class DbConnectionString : IEquatable<DbConnectionString>
{
Expand All @@ -14,7 +15,7 @@ public class DbConnectionString : IEquatable<DbConnectionString>

public DbConnectionString(string connectionString, string database)
{
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(connectionString);
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(NormalizeToLegacyConnectionString(connectionString));
if (database != null)
{
builder.InitialCatalog = database;
Expand Down Expand Up @@ -52,5 +53,30 @@ public override bool Equals(object obj)

return this.Equals(cnx);
}

private static readonly (string @new, string old)[] SqlPropertyRenames = new (string, string)[]
{
("Application Intent", "ApplicationIntent"),
("Connect Retry Count", "ConnectRetryCount"),
("Connect Retry Interval", "ConnectRetryInterval"),
("Pool Blocking Period", "PoolBlockingPeriod"),
("Multiple Active Result Sets", "MultipleActiveResultSets"),
("Multi Subnet Failover", "MultiSubnetFailover"),
("Transparent Network IP Resolution", "TransparentNetworkIPResolution"),
("Trust Server Certificate", "TrustServerCertificate")
};

public static string NormalizeToLegacyConnectionString(string connectionString)
{
if (!string.IsNullOrWhiteSpace(connectionString))
{
foreach (var replacement in SqlPropertyRenames)
{
connectionString = Regex.Replace(connectionString, replacement.@new, replacement.old, RegexOptions.IgnoreCase);
}
}

return connectionString;
}
}
}

0 comments on commit c8f0eac

Please sign in to comment.