Switch Tools Service to new SMO and Microsoft.Data.SqlClient driver (#865)

* switch to ambient props and targets files

* build against Microsoft.Data.SqlClient

* build tests

* fix test bug

* temporarily add SMO nuget to the repo

* update to released Microsoft.Data package
This commit is contained in:
David Shiflet
2019-09-17 17:51:19 -04:00
committed by GitHub
parent 47c9b968f6
commit 9d140b53f3
130 changed files with 160 additions and 183 deletions

View File

@@ -1,7 +1,8 @@
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<SmoPackageVersion>150.18147.0</SmoPackageVersion>
<SmoPackageVersion>160.1909171.0-preview</SmoPackageVersion>
<SqlClientPackageVersion>1.0.19249.1</SqlClientPackageVersion>
<HighEntropyVA>true</HighEntropyVA>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup>

10
src/Directory.Build.props Normal file
View File

@@ -0,0 +1,10 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="$(SqlClientPackageVersion)" />
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="$(SmoPackageVersion)" />
</ItemGroup>
</Project>

View File

@@ -8,7 +8,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Globalization;
using System.Linq;
using System.Threading;

View File

@@ -5,7 +5,7 @@
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.SqlTools.CoreServices.Connection.ReliableConnection;
public static class ConnectionUtils

View File

@@ -6,7 +6,7 @@
using System;
using System.Collections.Concurrent;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Linq;
using Microsoft.SqlTools.Hosting.Utility;

View File

@@ -5,7 +5,7 @@
using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.SqlTools.Hosting.Utility;
namespace Microsoft.SqlTools.CoreServices.Connection.ReliableConnection

View File

@@ -5,7 +5,7 @@
using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.SqlTools.Hosting.Utility;
namespace Microsoft.SqlTools.CoreServices.Connection.ReliableConnection

View File

@@ -6,7 +6,7 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;

View File

@@ -26,7 +26,7 @@
using System;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics.Contracts;
namespace Microsoft.SqlTools.CoreServices.Connection.ReliableConnection

View File

@@ -27,7 +27,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Globalization;
using System.Text;

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using Microsoft.SqlTools.Hosting.Utility;

View File

@@ -4,7 +4,7 @@
//
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
namespace Microsoft.SqlTools.CoreServices.Connection.ReliableConnection
{

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
namespace Microsoft.SqlTools.CoreServices.Connection.ReliableConnection
{

View File

@@ -4,7 +4,7 @@
//
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
namespace Microsoft.SqlTools.CoreServices.Connection.ReliableConnection
{

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
namespace Microsoft.SqlTools.CoreServices.Connection.ReliableConnection
{

View File

@@ -5,7 +5,7 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Globalization;
using System.Linq;
using System.Text;

View File

@@ -24,7 +24,7 @@
// namespace Microsoft.SqlServer.Management.Common
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Globalization;

View File

@@ -5,7 +5,7 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Runtime.InteropServices;
using Microsoft.SqlTools.Hosting.Utility;

View File

@@ -4,7 +4,7 @@
//
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.SmoMetadataProvider;
using Microsoft.SqlServer.Management.SqlParser.Binder;

View File

@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../Common.props" />
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>netstandard2.0</TargetFramework>
@@ -15,8 +14,6 @@
<Description>$(PackageDescription)</Description>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="$(SmoPackageVersion)" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.4" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
@@ -30,5 +27,4 @@
<EmbeddedResource Include="Localization\sr.resx" />
<None Include="Localization\sr.strings" />
</ItemGroup>
<Import Project="..\sqltools.common.targets" />
</Project>

View File

@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../Common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AssemblyName>MicrosoftSqlToolsCredentials</AssemblyName>
@@ -16,11 +15,6 @@
<RuntimeIdentifiers>win7-x64;win7-x86;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64;osx.10.11-x64;linux-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Data.SqlClient" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="$(SmoPackageVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.0" />
<PackageReference Include="System.IO.Packaging" Version="4.5.0" />

View File

@@ -12,5 +12,4 @@
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
</ItemGroup>
<Import Project="..\sqltools.common.targets" />
</Project>

View File

@@ -6,5 +6,4 @@
</PackageDescription>
<Description>$(PackageDescription)</Description>
</PropertyGroup>
<Import Project="..\sqltools.common.targets" />
</Project>

View File

@@ -31,5 +31,4 @@
<EmbeddedResource Include="Localization\sr.resx" />
<None Include="Localization\sr.strings" />
</ItemGroup>
<Import Project="..\sqltools.common.targets" />
</Project>

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Data.SqlClient" version="4.6.0-preview3-27014-02" />
<package id="Microsoft.SqlServer.Management.SqlScriptPublishModel" version="140.17050.0" />
<package id="Newtonsoft.Json" version="10.0.2" />
<package id="Microsoft.Extensions.DependencyModel" version="2.1.0" />
<package id="System.Runtime.Loader" version="4.3.0" />
<package id="System.Composition" version="1.2.0" />
</packages>

View File

@@ -5,7 +5,7 @@
using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;

View File

@@ -4,7 +4,7 @@
//
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.SqlTools.ManagedBatchParser;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode

View File

@@ -4,7 +4,7 @@
//
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
{

View File

@@ -5,7 +5,7 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Globalization;
using System.IO;
using Microsoft.SqlTools.ManagedBatchParser;

View File

@@ -6,7 +6,7 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;

View File

@@ -6,7 +6,7 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
{

View File

@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../Common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
@@ -9,10 +8,6 @@
<ItemGroup>
<Folder Include="Localization\transXliff\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="$(SmoPackageVersion)" />
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\sr.resx" />
<None Include="Localization\sr.strings" />

View File

@@ -6,7 +6,7 @@
using System;
using System.Collections.Concurrent;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Linq;
using Microsoft.SqlTools.Utility;

View File

@@ -5,7 +5,7 @@
using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.SqlTools.Utility;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection

View File

@@ -5,7 +5,7 @@
using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.SqlTools.Utility;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection

View File

@@ -6,7 +6,7 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
@@ -826,17 +826,24 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
// Get BDC endpoints
if (!serverInfo.IsCloud)
{
List<ClusterEndpoint> clusterEndpoints = new List<ClusterEndpoint>();
serverInfo.Options.Add(ServerInfo.OptionClusterEndpoints, clusterEndpoints);
if (serverInfo.ServerMajorVersion >= 15)
{
List<ClusterEndpoint> clusterEndpoints = new List<ClusterEndpoint>();
serverInfo.Options.Add(ServerInfo.OptionClusterEndpoints, clusterEndpoints);
try
{
LookupClusterEndpoints(connection, serverInfo, clusterEndpoints);
try
{
LookupClusterEndpoints(connection, serverInfo, clusterEndpoints);
}
catch (SqlException)
{
// Failed to find cluster endpoints DMV / table, this must not be a cluster
// or user does not have permissions to see cluster info
serverInfo.Options.Add(ServerInfo.OptionIsBigDataCluster, false);
}
}
catch (SqlException)
else
{
// Failed to find cluster endpoints DMV / table, this must not be a cluster
// or user does not have permissions to see cluster info
serverInfo.Options.Add(ServerInfo.OptionIsBigDataCluster, false);
}
}

View File

@@ -26,7 +26,7 @@
using System;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection

View File

@@ -27,7 +27,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Globalization;
using System.Text;

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using Microsoft.SqlTools.Utility;

View File

@@ -4,7 +4,7 @@
//
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
{

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
{

View File

@@ -4,7 +4,7 @@
//
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
{

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
{

View File

@@ -5,7 +5,7 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Globalization;
using System.Linq;
using System.Text;

View File

@@ -24,7 +24,7 @@
// namespace Microsoft.SqlServer.Management.Common
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Globalization;

View File

@@ -5,7 +5,7 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Runtime.InteropServices;
using Microsoft.SqlTools.Utility;

View File

@@ -4,7 +4,7 @@
using System;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Linq;
namespace Microsoft.SqlTools.ResourceProvider.Core

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Net;
using System.Text.RegularExpressions;

View File

@@ -11,7 +11,6 @@
<Copyright><EFBFBD> Microsoft Corporation. All rights reserved.</Copyright>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="System.Composition" Version="1.1.0" />

View File

@@ -14,7 +14,6 @@
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="1.6.0-preview" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.10" />
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.10" />
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="System.Composition" Version="1.1.0" />

View File

@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../Common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<PackageId>SqlToolsResourceProviderService</PackageId>

View File

@@ -6,20 +6,15 @@
using System;
using System.Linq;
using System.Collections.Generic;
using System.Globalization;
using Microsoft.SqlServer.Diagnostics.STrace;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlTools.ServiceLayer.Management;
using Microsoft.Win32;
using SizeUnits = Microsoft.SqlTools.ServiceLayer.Management.DbSize.SizeUnits;
namespace Microsoft.SqlTools.ServiceLayer.Admin
{
public static class AzureSqlDbHelper
{
private static readonly TraceContext TraceContext = TraceContext.GetTraceContext("AzureSqlDbUtils", typeof(AzureSqlDbHelper).Name);
/// <summary>
/// Registry sub key for the AzureServiceObjectives overrides
/// </summary>

View File

@@ -17,7 +17,7 @@ using Smo = Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Diagnostics;
using System.Globalization;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Collections.Generic;
using AzureEdition = Microsoft.SqlTools.ServiceLayer.Admin.AzureSqlDbHelper.AzureEdition;
using Microsoft.SqlTools.ServiceLayer.Management;

View File

@@ -13,7 +13,7 @@ using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Diagnostics;
using System.Globalization;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Collections.Generic;
using System.Diagnostics;
using AzureEdition = Microsoft.SqlTools.ServiceLayer.Admin.AzureSqlDbHelper.AzureEdition;

View File

@@ -5,7 +5,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Globalization;
using System.Linq;
using Microsoft.SqlServer.Management.Common;

View File

@@ -7,7 +7,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.SqlTools.ServiceLayer.Agent.Contracts;

View File

@@ -6,7 +6,7 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Smo.Agent;

View File

@@ -8,7 +8,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Globalization;
using System.Linq;
using System.Threading;

View File

@@ -8,7 +8,7 @@ using Microsoft.SqlTools.ServiceLayer.TaskServices;
using Microsoft.SqlTools.ServiceLayer.Utility;
using Microsoft.SqlTools.Utility;
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Threading;

View File

@@ -9,7 +9,7 @@ using Microsoft.SqlTools.ServiceLayer.Hosting;
using Microsoft.SqlTools.ServiceLayer.TaskServices;
using System;
using System.Collections.Concurrent;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Threading.Tasks;
namespace Microsoft.SqlTools.ServiceLayer.DacFx

View File

@@ -8,7 +8,7 @@ using Microsoft.SqlTools.ServiceLayer.DacFx.Contracts;
using Microsoft.SqlTools.ServiceLayer.TaskServices;
using Microsoft.SqlTools.Utility;
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
namespace Microsoft.SqlTools.ServiceLayer.DacFx

View File

@@ -8,7 +8,7 @@ using Microsoft.SqlTools.ServiceLayer.DacFx.Contracts;
using Microsoft.SqlTools.ServiceLayer.TaskServices;
using Microsoft.SqlTools.Utility;
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
namespace Microsoft.SqlTools.ServiceLayer.DacFx

View File

@@ -8,7 +8,7 @@ using Microsoft.SqlTools.ServiceLayer.DacFx.Contracts;
using Microsoft.SqlTools.ServiceLayer.TaskServices;
using Microsoft.SqlTools.Utility;
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Globalization;

View File

@@ -8,7 +8,7 @@ using Microsoft.SqlTools.ServiceLayer.DacFx.Contracts;
using Microsoft.SqlTools.ServiceLayer.TaskServices;
using Microsoft.SqlTools.Utility;
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
namespace Microsoft.SqlTools.ServiceLayer.DacFx

View File

@@ -8,7 +8,7 @@ using Microsoft.SqlTools.ServiceLayer.DacFx.Contracts;
using Microsoft.SqlTools.ServiceLayer.TaskServices;
using Microsoft.SqlTools.Utility;
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.IO;

View File

@@ -8,7 +8,7 @@ using Microsoft.SqlTools.ServiceLayer.DacFx.Contracts;
using Microsoft.SqlTools.ServiceLayer.TaskServices;
using Microsoft.SqlTools.Utility;
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
namespace Microsoft.SqlTools.ServiceLayer.DacFx

View File

@@ -7,7 +7,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Smo;

View File

@@ -7,7 +7,7 @@ using Microsoft.SqlTools.ServiceLayer.Admin;
using Microsoft.SqlTools.ServiceLayer.DisasterRecovery.Contracts;
using Microsoft.SqlTools.ServiceLayer.Management;
using Microsoft.SqlTools.ServiceLayer.TaskServices;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery
{

View File

@@ -6,7 +6,7 @@
using System;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Globalization;
using System.IO;
using Microsoft.SqlServer.Management.Sdk.Sfc;

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.SqlTools.Hosting.Protocol;

View File

@@ -6,7 +6,7 @@
using System;
using System.Linq;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlTools.ServiceLayer.Connection;

View File

@@ -6,7 +6,7 @@
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlTools.ServiceLayer.Connection;

View File

@@ -7,7 +7,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

View File

@@ -6,7 +6,7 @@
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.SqlTools.ServiceLayer.EditData.Contracts;

View File

@@ -8,7 +8,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Globalization;
using System.Linq;
using System.Text;

View File

@@ -10,7 +10,7 @@ using System.Globalization;
using System.Linq;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Sdk.Sfc;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
namespace Microsoft.SqlTools.ServiceLayer.FileBrowser
{

View File

@@ -5,7 +5,7 @@
using System;
using System.Collections.Concurrent;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.SqlTools.Hosting.Protocol;

View File

@@ -5,7 +5,7 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Linq;
using System.Net.Sockets;

View File

@@ -4,7 +4,7 @@
//
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.SmoMetadataProvider;
using Microsoft.SqlServer.Management.SqlParser.Binder;

View File

@@ -5,7 +5,7 @@
using System;
using System.Collections;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Globalization;
using System.IO;
using System.Reflection;

View File

@@ -5,7 +5,7 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Threading.Tasks;
using Microsoft.SqlTools.Hosting.Protocol;
using Microsoft.SqlTools.ServiceLayer.Connection;

View File

@@ -6,7 +6,7 @@
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlTools.ServiceLayer.Connection;

View File

@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../Common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AssemblyName>MicrosoftSqlToolsServiceLayer</AssemblyName>
@@ -21,8 +20,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="$(SmoPackageVersion)" />
<PackageReference Include="Microsoft.SqlServer.DacFx" Version="150.4534.2-preview" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.6.0-preview3-26501-04" />
</ItemGroup>

View File

@@ -5,7 +5,7 @@
using System;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Globalization;
using System.Linq;

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;

View File

@@ -5,7 +5,7 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Linq;
using System.Xml;
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;

View File

@@ -7,7 +7,7 @@ using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Linq;
using System.Text;

View File

@@ -6,7 +6,7 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Linq;
using System.Threading;

View File

@@ -7,7 +7,7 @@ using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Diagnostics;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

View File

@@ -5,7 +5,7 @@
using System;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Data.SqlTypes;
using System.Diagnostics;
using System.IO;

View File

@@ -5,7 +5,7 @@
using System;
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

View File

@@ -5,7 +5,7 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.SqlTools.ServiceLayer.Connection;
using Microsoft.SqlTools.ServiceLayer.Scripting.Contracts;
using Microsoft.SqlTools.Utility;
@@ -26,7 +26,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
/// </summary>
public class ScriptAsScriptingOperation : SmoScriptingOperation
{
private static Dictionary<string, SqlServerVersion> scriptCompatabilityMap = LoadScriptCompatabilityMap();
private static readonly Dictionary<string, SqlServerVersion> scriptCompatibilityMap = LoadScriptCompatibilityMap();
/// <summary>
/// Left delimiter for an named object
/// </summary>
@@ -548,18 +548,20 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
}
}
private static Dictionary<string, SqlServerVersion> LoadScriptCompatabilityMap()
private static Dictionary<string, SqlServerVersion> LoadScriptCompatibilityMap()
{
Dictionary<string, SqlServerVersion> map = new Dictionary<string, SqlServerVersion>();
map.Add(SqlScriptOptions.ScriptCompatabilityOptions.Script140Compat.ToString(), SqlServerVersion.Version140);
map.Add(SqlScriptOptions.ScriptCompatabilityOptions.Script130Compat.ToString(), SqlServerVersion.Version130);
map.Add(SqlScriptOptions.ScriptCompatabilityOptions.Script120Compat.ToString(), SqlServerVersion.Version120);
map.Add(SqlScriptOptions.ScriptCompatabilityOptions.Script110Compat.ToString(), SqlServerVersion.Version110);
map.Add(SqlScriptOptions.ScriptCompatabilityOptions.Script105Compat.ToString(), SqlServerVersion.Version105);
map.Add(SqlScriptOptions.ScriptCompatabilityOptions.Script100Compat.ToString(), SqlServerVersion.Version100);
map.Add(SqlScriptOptions.ScriptCompatabilityOptions.Script90Compat.ToString(), SqlServerVersion.Version90);
return new Dictionary<string, SqlServerVersion>
{
{SqlScriptOptions.ScriptCompatibilityOptions.Script150Compat.ToString(), SqlServerVersion.Version150},
{SqlScriptOptions.ScriptCompatibilityOptions.Script140Compat.ToString(), SqlServerVersion.Version140},
{SqlScriptOptions.ScriptCompatibilityOptions.Script130Compat.ToString(), SqlServerVersion.Version130},
{SqlScriptOptions.ScriptCompatibilityOptions.Script120Compat.ToString(), SqlServerVersion.Version120},
{SqlScriptOptions.ScriptCompatibilityOptions.Script110Compat.ToString(), SqlServerVersion.Version110},
{SqlScriptOptions.ScriptCompatibilityOptions.Script105Compat.ToString(), SqlServerVersion.Version105},
{SqlScriptOptions.ScriptCompatibilityOptions.Script100Compat.ToString(), SqlServerVersion.Version100},
{SqlScriptOptions.ScriptCompatibilityOptions.Script90Compat.ToString(), SqlServerVersion.Version90}
};
return map;
}
private void SetScriptingOptions(ScriptingOptions scriptingOptions)
@@ -572,7 +574,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
//We always want role memberships for users and database roles to be scripted
scriptingOptions.IncludeDatabaseRoleMemberships = true;
SqlServerVersion targetServerVersion;
if(scriptCompatabilityMap.TryGetValue(this.Parameters.ScriptOptions.ScriptCompatibilityOption, out targetServerVersion))
if(scriptCompatibilityMap.TryGetValue(this.Parameters.ScriptOptions.ScriptCompatibilityOption, out targetServerVersion))
{
scriptingOptions.TargetServerVersion = targetServerVersion;
}

View File

@@ -5,7 +5,7 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Reflection;

View File

@@ -5,7 +5,7 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.Linq;
using Microsoft.SqlServer.Management.SqlScriptPublish;

View File

@@ -8,7 +8,7 @@ using Microsoft.SqlTools.ServiceLayer.Connection;
using Microsoft.SqlTools.ServiceLayer.Scripting.Contracts;
using Microsoft.SqlTools.Utility;
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using System.IO;
using System.Reflection;

View File

@@ -5,7 +5,7 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Security;
using System.Text;
using Microsoft.SqlServer.Management.Common;

View File

@@ -0,0 +1,10 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="$(SqlClientPackageVersion)" />
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="$(SmoPackageVersion)" />
</ItemGroup>
</Project>

View File

@@ -4,7 +4,7 @@
//
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics;
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;

View File

@@ -10,7 +10,7 @@ using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
using Microsoft.SqlTools.ServiceLayer.Test.Common;
using Microsoft.SqlTools.ServiceLayer.Test.Common.Baselined;
using System;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Globalization;
using System.IO;
using System.Text;

Some files were not shown because too many files have changed in this diff Show More