Skip to content

Commit 2b9870b

Browse files
authored
Merge | SqlAppContextSwitchManager (#3389)
* Move context switch manager into common project * Wrap in #if NET Cleanup package references in common project * Gotta keep stuff alphabetical
1 parent 7d809a8 commit 2b9870b

File tree

3 files changed

+28
-14
lines changed

3 files changed

+28
-14
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,9 @@
495495
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlAeadAes256CbcHmac256Factory.cs">
496496
<Link>Microsoft\Data\SqlClient\SqlAeadAes256CbcHmac256Factory.cs</Link>
497497
</Compile>
498+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlAppContextSwitchManager.netcore.cs">
499+
<Link>Microsoft\Data\SqlClient\SqlAppContextSwitchManager.netcore.cs</Link>
500+
</Compile>
498501
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlAuthenticationParameters.cs">
499502
<Link>Microsoft\Data\SqlClient\SqlAuthenticationParameters.cs</Link>
500503
</Compile>
@@ -807,8 +810,7 @@
807810
<Compile Include="$(CommonSourceRoot)System\Diagnostics\CodeAnalysis.cs">
808811
<Link>System\Diagnostics\CodeAnalysis.cs</Link>
809812
</Compile>
810-
811-
<Compile Include="Microsoft\Data\SqlClient\SqlAppContextSwitchManager.NetCoreApp.cs" />
813+
812814
<Compile Include="Microsoft\Data\SqlClient\SqlCommand.cs" />
813815
<Compile Include="Microsoft\Data\SqlClient\SqlConnection.cs" />
814816
<Compile Include="Microsoft\Data\SqlClient\SqlConnectionHelper.cs" />
Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFrameworks>net462;net8.0;net9.0</TargetFrameworks>
4-
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
5-
<RootNamespace />
6-
</PropertyGroup>
7-
2+
<PropertyGroup>
3+
<TargetFrameworks>net462;net8.0;net9.0</TargetFrameworks>
4+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
5+
<RootNamespace />
6+
</PropertyGroup>
7+
8+
<!-- References ====================================================== -->
89
<ItemGroup>
9-
<Reference Include="System.Configuration" Condition="'$(TargetFramework)' == 'net462'" />
10-
<Reference Include="System.Transactions" Condition="'$(TargetFramework)' == 'net462'" />
11-
</ItemGroup>
12-
<ItemGroup>
10+
<!-- References that apply to all target frameworks -->
1311
<PackageReference Include="Microsoft.Bcl.Cryptography" />
1412
<PackageReference Include="System.Buffers" />
1513
<PackageReference Include="System.Memory" />
16-
<PackageReference Include="System.Data.Common" Condition="'$(TargetFramework)' == 'net462'" />
1714
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" />
18-
<PackageReference Include="System.Security.Cryptography.Pkcs" />
15+
<PackageReference Include="System.Security.Cryptography.Pkcs" />
16+
</ItemGroup>
17+
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
18+
<!-- References that only apply to net462 -->
19+
<Reference Include="System.Configuration" />
20+
<Reference Include="System.Configuration.ConfigurationManager" />
21+
<Reference Include="System.Transactions" />
22+
<PackageReference Include="System.Data.Common" />
23+
</ItemGroup>
24+
<ItemGroup Condition="'$(TargetFramework)' != 'net462'">
25+
<!-- References that only apply to netcore -->
26+
<PackageReference Include="System.Configuration.ConfigurationManager" />
1927
</ItemGroup>
2028
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
#if NET
6+
57
using System;
68
using System.Configuration;
79

@@ -70,3 +72,5 @@ public string Value
7072
}
7173
}
7274
}
75+
76+
#endif

0 commit comments

Comments
 (0)