Skip to content

Commit b452941

Browse files
committed
Wrap in #if NET
Cleanup package references in common project
1 parent 48530c1 commit b452941

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,26 @@
44
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
55
<RootNamespace />
66
</PropertyGroup>
7-
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 -->
11+
12+
<Reference Include="System.Configuration.ConfigurationManager" />
1313
<PackageReference Include="Microsoft.Bcl.Cryptography" Version="$(MicrosoftBclCryptographyVersion)" />
1414
<PackageReference Include="System.Buffers" Version="$(SystemBuffersVersion)" />
1515
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
16-
<PackageReference Include="System.Data.Common" Version="$(SystemDataCommonVersion)" Condition="'$(TargetFramework)' == 'net462'" />
1716
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="$(SystemRuntimeInteropServicesRuntimeInformationVersion)" />
1817
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="$(SystemSecurityCryptographyPkcsVersion)" />
1918
</ItemGroup>
19+
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
20+
<!-- References that only apply to net462 -->
21+
<Reference Include="System.Configuration" />
22+
<Reference Include="System.Transactions" />
23+
<PackageReference Include="System.Data.Common" Version="$(SystemDataCommonVersion)" />
24+
</ItemGroup>
25+
<ItemGroup Condition="'$(TargetFramework)' != 'net462'">
26+
<!-- References that only apply to netcore -->
27+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="$(SystemConfigurationConfigurationManagerVersion)" />
28+
</ItemGroup>
2029
</Project>

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

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)