Skip to content

Commit 86d22a7

Browse files
committed
Merge branch 'main' into tests/common-project-fixtures
2 parents b7fa2da + 95253ac commit 86d22a7

29 files changed

+519
-1041
lines changed

src/Directory.Packages.props

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
<PackageVersion Include="Microsoft.Data.SqlClient.SNI" Version="6.0.2" />
99
<PackageVersion Include="System.Buffers" Version="4.5.1" />
1010
<PackageVersion Include="System.Memory" Version="4.5.5" />
11-
<PackageVersion Include="System.Text.Encodings.Web" Version="8.0.0" />
12-
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
1311
<PackageVersion Include="System.Data.Common" Version="4.3.0" />
12+
<PackageVersion Include="System.Text.Encodings.Web" Version="8.0.0" />
1413
</ItemGroup>
1514
<!-- NetFx and NetCore project dependencies -->
1615
<ItemGroup>
@@ -54,15 +53,17 @@
5453
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
5554
<PackageVersion Include="Microsoft.Bcl.Cryptography" Version="9.0.5" />
5655
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.5" />
57-
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="9.0.5" />
58-
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.5" />
5956
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.5" />
57+
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.5" />
58+
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="9.0.5" />
59+
<PackageVersion Include="System.Text.Json" Version="9.0.5" />
6060
</ItemGroup>
6161
<ItemGroup Condition="'$(TargetFramework)' != 'net9.0'">
6262
<PackageVersion Include="Microsoft.Bcl.Cryptography" Version="8.0.0" />
6363
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
64-
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="8.0.1" />
65-
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.1" />
6664
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
65+
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.1" />
66+
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="8.0.1" />
67+
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
6768
</ItemGroup>
6869
</Project>

src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
<BuildProjectReferences>false</BuildProjectReferences>
1616
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1717
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
18+
<IsTrimmable Condition="'$(TargetGroup)'=='netcoreapp'">true</IsTrimmable>
19+
<IsAotCompatible Condition="'$(TargetGroup)'=='netcoreapp'">true</IsAotCompatible>
1820
</PropertyGroup>
1921
<!--Generating Strong Name-->
2022
<PropertyGroup Condition="'$(CDP_BUILD_TYPE)'=='Official'">

src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,18 @@
3232
<Compile Include="..\..\ref\Microsoft.Data.SqlClient.Batch.NetCoreApp.cs" />
3333
</ItemGroup>
3434
<ItemGroup>
35+
<PackageReference Include="Azure.Identity" />
36+
<PackageReference Include="Microsoft.Bcl.Cryptography" />
3537
<PackageReference Include="Microsoft.Data.SqlClient.SNI.runtime" />
3638
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
37-
<PackageReference Include="Microsoft.SqlServer.Server" />
38-
<PackageReference Include="Azure.Identity" />
39-
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" />
4039
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" />
40+
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" />
41+
<PackageReference Include="Microsoft.SqlServer.Server" />
4142
<PackageReference Include="System.Configuration.ConfigurationManager" />
4243
<PackageReference Include="System.Security.Cryptography.Pkcs" />
43-
<PackageReference Include="Microsoft.Bcl.Cryptography" />
44+
45+
<!-- Transitive dependencies that would otherwise bring in older, vulnerable versions. -->
46+
<PackageReference Include="System.Text.Json" />
4447
</ItemGroup>
4548

4649
<Import Project="$(ToolsDir)targets\ResolveContract.targets" Condition="'$(OSGroup)' == 'AnyOS' AND '$(TargetGroup)' != 'netcoreapp'" />

src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -663,8 +663,8 @@
663663
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlInternalTransaction.cs">
664664
<Link>Microsoft\Data\SqlClient\SqlInternalTransaction.cs</Link>
665665
</Compile>
666-
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlMetadataFactory.cs">
667-
<Link>Microsoft\Data\SqlClient\SqlMetadataFactory.cs</Link>
666+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlMetaDataFactory.cs">
667+
<Link>Microsoft\Data\SqlClient\SqlMetaDataFactory.cs</Link>
668668
</Compile>
669669
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlNotificationEventArgs.cs">
670670
<Link>Microsoft\Data\SqlClient\SqlNotificationEventArgs.cs</Link>
@@ -802,7 +802,6 @@
802802
<Link>System\Diagnostics\CodeAnalysis.cs</Link>
803803
</Compile>
804804

805-
<Compile Include="Microsoft\Data\Common\ConnectionString\DbConnectionOptions.netcore.cs" />
806805
<Compile Include="Microsoft\Data\SqlClient\SqlAppContextSwitchManager.NetCoreApp.cs" />
807806
<Compile Include="Microsoft\Data\SqlClient\SqlBulkCopy.cs" />
808807
<Compile Include="Microsoft\Data\SqlClient\SqlConnectionFactory.AssemblyLoadContext.cs" />
@@ -1036,18 +1035,20 @@
10361035
</ItemGroup>
10371036
<!-- Package References Etc -->
10381037
<ItemGroup>
1038+
<PackageReference Include="Azure.Identity" />
1039+
<PackageReference Include="Microsoft.Bcl.Cryptography" />
10391040
<PackageReference Include="Microsoft.Data.SqlClient.SNI.runtime" />
10401041
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
1041-
<!-- Enable the project reference for debugging purposes. -->
1042-
<!-- <ProjectReference Include="$(SqlServerSourceCode)\Microsoft.SqlServer.Server.csproj" /> -->
1043-
<PackageReference Include="Microsoft.SqlServer.Server" />
1044-
<PackageReference Include="Azure.Identity" />
1045-
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" />
10461042
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" />
1043+
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" />
1044+
<PackageReference Include="Microsoft.SqlServer.Server" />
10471045
<PackageReference Include="System.Configuration.ConfigurationManager" />
10481046
<PackageReference Include="System.Security.Cryptography.Pkcs" />
1049-
<PackageReference Include="Microsoft.Bcl.Cryptography" />
1047+
1048+
<!-- Transitive dependencies that would otherwise bring in older, vulnerable versions. -->
1049+
<PackageReference Include="System.Text.Json" />
10501050
</ItemGroup>
1051+
10511052
<Import Project="$(ToolsDir)targets\GenerateThisAssemblyCs.targets" />
10521053
<Import Project="$(ToolsDir)targets\ResolveContract.targets" Condition="'$(OSGroup)' == 'AnyOS'" />
10531054
<Import Project="$(ToolsDir)targets\NotSupported.targets" Condition="'$(OSGroup)' == 'AnyOS'" />

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Common/ConnectionString/DbConnectionOptions.netcore.cs

Lines changed: 0 additions & 74 deletions
This file was deleted.

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnectionFactory.cs

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,30 @@ override public DbProviderFactory ProviderFactory
3333
}
3434
}
3535

36-
override protected DbConnectionInternal CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, object poolGroupProviderInfo, IDbConnectionPool pool, DbConnection owningConnection)
36+
protected override DbConnectionInternal CreateConnection(
37+
DbConnectionOptions options,
38+
DbConnectionPoolKey poolKey,
39+
DbConnectionPoolGroupProviderInfo poolGroupProviderInfo,
40+
IDbConnectionPool pool,
41+
DbConnection owningConnection)
3742
{
3843
return CreateConnection(options, poolKey, poolGroupProviderInfo, pool, owningConnection, userOptions: null);
3944
}
4045

41-
override protected DbConnectionInternal CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, object poolGroupProviderInfo, IDbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
46+
protected override DbConnectionInternal CreateConnection(
47+
DbConnectionOptions options,
48+
DbConnectionPoolKey poolKey,
49+
DbConnectionPoolGroupProviderInfo poolGroupProviderInfo,
50+
IDbConnectionPool pool,
51+
DbConnection owningConnection,
52+
DbConnectionOptions userOptions)
4253
{
4354
SqlConnectionString opt = (SqlConnectionString)options;
4455
SqlConnectionPoolKey key = (SqlConnectionPoolKey)poolKey;
4556
SessionData recoverySessionData = null;
4657

4758
SqlConnection sqlOwningConnection = (SqlConnection)owningConnection;
48-
bool applyTransientFaultHandling = sqlOwningConnection != null ? sqlOwningConnection._applyTransientFaultHandling : false;
59+
bool applyTransientFaultHandling = sqlOwningConnection?._applyTransientFaultHandling ?? false;
4960

5061
SqlConnectionString userOpt = null;
5162
if (userOptions != null)
@@ -137,7 +148,20 @@ override protected DbConnectionInternal CreateConnection(DbConnectionOptions opt
137148
opt = new SqlConnectionString(opt, instanceName, userInstance: false, setEnlistValue: null);
138149
poolGroupProviderInfo = null; // null so we do not pass to constructor below...
139150
}
140-
return new SqlInternalConnectionTds(identity, opt, key.Credential, poolGroupProviderInfo, "", null, redirectedUserInstance, userOpt, recoverySessionData, applyTransientFaultHandling, key.AccessToken, pool, key.AccessTokenCallback);
151+
return new SqlInternalConnectionTds(
152+
identity,
153+
opt,
154+
key.Credential,
155+
poolGroupProviderInfo,
156+
newPassword: string.Empty,
157+
newSecurePassword: null,
158+
redirectedUserInstance,
159+
userOpt,
160+
recoverySessionData,
161+
applyTransientFaultHandling,
162+
key.AccessToken,
163+
pool,
164+
key.AccessTokenCallback);
141165
}
142166

143167
protected override DbConnectionOptions CreateConnectionOptions(string connectionString, DbConnectionOptions previous)

src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@
3232
<Reference Include="System.Transactions" />
3333
</ItemGroup>
3434
<ItemGroup>
35-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
36-
<PackageReference Include="System.Text.Encodings.Web" />
35+
<PackageReference Include="Azure.Identity" />
36+
<PackageReference Include="Microsoft.Bcl.Cryptography" />
3737
<PackageReference Include="Microsoft.Data.SqlClient.SNI">
3838
<PrivateAssets>All</PrivateAssets>
3939
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4040
</PackageReference>
41-
<PackageReference Include="Azure.Identity" />
42-
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" />
41+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
4342
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" />
43+
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" />
4444
<PackageReference Include="System.Buffers" />
45-
<PackageReference Include="System.Text.Json" />
4645
<PackageReference Include="System.Data.Common" />
4746
<PackageReference Include="System.Security.Cryptography.Pkcs" />
48-
<PackageReference Include="Microsoft.Bcl.Cryptography" />
47+
<PackageReference Include="System.Text.Encodings.Web" />
48+
<PackageReference Include="System.Text.Json" />
4949
</ItemGroup>
5050
<Import Project="$(ToolsDir)targets\TrimDocsForIntelliSense.targets" />
5151
</Project>

src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.Net.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<ProjectGuid>{407890AC-9876-4FEF-A6F1-F36A876BAADE}</ProjectGuid>
44
<RootNamespace></RootNamespace>
@@ -12,9 +12,6 @@
1212
<DocumentationFile>$(OutputPath)\Microsoft.Data.SqlClient.xml</DocumentationFile>
1313
<IntermediateOutputPath>$(ObjPath)$(AssemblyName)\netfx\</IntermediateOutputPath>
1414
<Product>Framework $(BaseProduct)</Product>
15-
<!-- ResolveComReferenceSilent suppresses warnings thrown due to the inclusion of mscoree.
16-
We should remove ResolveComReferenceSilent as soon as we can remove the dependency on mscoree. -->
17-
<ResolveComReferenceSilent>True</ResolveComReferenceSilent>
1815
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
1916
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
2017
</PropertyGroup>
@@ -61,7 +58,10 @@
6158
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
6259
<Utf8Output>True</Utf8Output>
6360
<ErrorReport>None</ErrorReport>
64-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
61+
62+
<!-- This code analysis ruleset only exists with the .NET Framework toolset. -->
63+
<CodeAnalysisRuleSet Condition="$(MSBuildRuntimeType) == 'Full'">MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
64+
6565
<BuildProjectReferences>True</BuildProjectReferences>
6666
<GenerateAssemblyRefs>True</GenerateAssemblyRefs>
6767
<DefineConstants>$(DefineConstants);USEOFFSET;CODE_ANALYSIS_BASELINE;FEATURE_LEGACYSURFACEAREA;FEATURE_UTF32;FEATURE_UTF7;TRACE;</DefineConstants>
@@ -258,6 +258,9 @@
258258
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Common\ConnectionString\DbConnectionStringSynonyms.cs">
259259
<Link>Microsoft\Data\Common\ConnectionString\DbConnectionStringSynonyms.cs</Link>
260260
</Compile>
261+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Common\ConnectionString\DbConnectionString.netfx.cs">
262+
<Link>Microsoft\Data\Common\ConnectionString\DbConnectionString.netfx.cs</Link>
263+
</Compile>
261264
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Common\ConnectionString\DbConnectionStringUtilities.cs">
262265
<Link>Microsoft\Data\Common\ConnectionString\DbConnectionStringUtilities.cs</Link>
263266
</Compile>
@@ -948,10 +951,7 @@
948951
<Compile Include="$(CommonSourceRoot)System\IO\StreamExtensions.netfx.cs">
949952
<Link>System\IO\StreamExtensions.netfx.cs</Link>
950953
</Compile>
951-
</ItemGroup>
952-
<ItemGroup>
953-
<Compile Include="Microsoft\Data\Common\ConnectionString\DbConnectionOptions.netfx.cs" />
954-
<Compile Include="Microsoft\Data\Common\DbConnectionString.cs" />
954+
955955
<Compile Include="Microsoft\Data\SqlClient\SqlBulkCopy.cs" />
956956
<Compile Include="Microsoft\Data\SqlClient\SqlClientWrapperSmiStream.cs" />
957957
<Compile Include="Microsoft\Data\SqlClient\SqlClientWrapperSmiStreamChars.cs" />
@@ -1000,29 +1000,18 @@
10001000
</EmbeddedResource>
10011001
</ItemGroup>
10021002
<ItemGroup>
1003-
<COMReference Include="mscoree">
1004-
<Guid>{5477469E-83B1-11D2-8B49-00A0C9B7C9C4}</Guid>
1005-
<VersionMajor>2</VersionMajor>
1006-
<VersionMinor>4</VersionMinor>
1007-
<Lcid>0</Lcid>
1008-
<WrapperTool>tlbimp</WrapperTool>
1009-
<Isolated>False</Isolated>
1010-
<EmbedInteropTypes>True</EmbedInteropTypes>
1011-
</COMReference>
1012-
</ItemGroup>
1013-
<ItemGroup>
1014-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
1015-
<PackageReference Include="System.Text.Encodings.Web" />
1003+
<PackageReference Include="Azure.Identity" />
1004+
<PackageReference Include="Microsoft.Bcl.Cryptography" />
10161005
<PackageReference Include="Microsoft.Data.SqlClient.SNI">
10171006
<PrivateAssets>All</PrivateAssets>
10181007
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
10191008
</PackageReference>
1020-
<PackageReference Include="Azure.Identity" />
1021-
<PackageReference Include="Microsoft.Bcl.Cryptography" />
1022-
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" />
1009+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
10231010
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" />
1011+
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" />
10241012
<PackageReference Include="System.Buffers" />
10251013
<PackageReference Include="System.Security.Cryptography.Pkcs" />
1014+
<PackageReference Include="System.Text.Encodings.Web" />
10261015
<PackageReference Include="System.Text.Json" />
10271016
</ItemGroup>
10281017
<Import Project="$(CommonSourceRoot)tools\targets\GenerateResourceStringsSource.targets" />

0 commit comments

Comments
 (0)