Skip to content

Commit

Permalink
Enhancement | Add explicit version for major .NET version dependencies (
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikEJ authored Jan 23, 2024
1 parent 4ca71d9 commit c8b70f1
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 20 deletions.
1 change: 1 addition & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@

<!-- Provides Version properties -->
<Import Project="$(ToolsDir)props\Versions.props" />
<Import Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))" Project="$(ToolsDir)props\VersionsNet8OrLater.props" />
<!-- Provides Tool properties -->
<Import Project="$(ToolsDir)props\Tools.props" />
<!-- Provides Build properties -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -985,26 +985,32 @@
<LogicalName>Microsoft.Data.SqlClient.SqlMetaData.xml</LogicalName>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Condition="$(TargetGroup) == 'netstandard' and '$(TargetsWindows)' == 'true' and '$(IsUAPAssembly)' != 'true'" Include="Microsoft.Win32.Registry" Version="$(MicrosoftWin32RegistryVersion)" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="$(SystemConfigurationConfigurationManagerVersion)" />
<PackageReference Include="System.Security.Permissions" Version="$(SystemSecurityPermissionsVersion)" />
<PackageReference Condition="$(TargetGroup) == 'netstandard'" Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsVersion)" />
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard'">
<PackageReference Condition="'$(TargetsWindows)' == 'true' and '$(IsUAPAssembly)' != 'true'" Include="Microsoft.Win32.Registry" Version="$(MicrosoftWin32RegistryVersion)" />
<PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsVersion)" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourceVersion)" />
<PackageReference Include="System.Buffers" Version="$(SystemBuffersVersion)" />
<PackageReference Include="System.Runtime.Loader" Version="$(SystemRuntimeLoaderVersion)" />
<PackageReference Include="System.Security.Cryptography.Cng" Version="$(SystemSecurityCryptographyCngVersion)" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="$(SystemTextEncodingCodePagesVersion)" />
<PackageReference Include="System.Text.Encodings.Web" Version="$(SystemTextEncodingsWebVersion)" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="$(SystemConfigurationConfigurationManagerVersion)" />
<PackageReference Include="System.Security.Permissions" Version="$(SystemSecurityPermissionsVersion)" />
<PackageReference Include="System.Runtime.Caching" Version="$(SystemRuntimeCachingVersion)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp'">
<PackageReference Include="System.Configuration.ConfigurationManager" Version="$(SystemConfigurationConfigurationManagerVersion)" />
<PackageReference Include="System.Runtime.Caching" Version="$(SystemRuntimeCachingVersion)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient.SNI.runtime" Version="$(MicrosoftDataSqlClientSNIRuntimeVersion)" />
<!-- Enable the project reference for debugging purposes. -->
<!-- <ProjectReference Include="$(SqlServerSourceCode)\Microsoft.SqlServer.Server.csproj" /> -->
<PackageReference Include="Microsoft.SqlServer.Server" Version="$(MicrosoftSqlServerServerVersion)" />
<PackageReference Condition="$(TargetGroup) == 'netstandard'" Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourceVersion)" />
<PackageReference Include="Azure.Identity" Version="$(AzureIdentityVersion)" />
<PackageReference Include="Microsoft.Identity.Client" Version="$(MicrosoftIdentityClientVersion)" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="$(MicrosoftIdentityModelProtocolsOpenIdConnectVersion)" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="$(MicrosoftIdentityModelJsonWebTokensVersion)" />
<PackageReference Condition="'$(TargetFramework)' == 'netstandard2.0'" Include="System.Buffers" Version="$(SystemBuffersVersion)" />
<PackageReference Include="System.Runtime.Caching" Version="$(SystemRuntimeCachingVersion)" />
<PackageReference Condition="$(TargetGroup) == 'netstandard'" Include="System.Runtime.Loader" Version="$(SystemRuntimeLoaderVersion)" />
<PackageReference Condition="$(TargetGroup) == 'netstandard'" Include="System.Security.Cryptography.Cng" Version="$(SystemSecurityCryptographyCngVersion)" />
<PackageReference Condition="$(BuildForRelease) == 'true'" Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubVersion)" PrivateAssets="All" />
</ItemGroup>
<Import Project="$(ToolsDir)targets\GenerateThisAssemblyCs.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,6 @@
<ProjectReference Include="$(AddOnsPath)AzureKeyVaultProvider\Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj" />
<PackageReference Include="Azure.Identity" Version="$(AzureIdentityVersion)" />
<PackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="$(MicrosoftIdentityModelClientsActiveDirectoryVersion)" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="$(SystemConfigurationConfigurationManagerVersion)" />
<PackageReference Include="System.Runtime.Caching" Version="$(SystemRuntimeCachingVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="$(SystemIdentityModelTokensJwtVersion)" />
<PackageReference Condition="'$(TargetGroup)'=='netfx'" Include="Microsoft.SqlServer.Types" Version="$(MicrosoftSqlServerTypesVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<ProjectReference Include="$(NetCoreSource)src\Microsoft.Data.SqlClient.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Runtime.Caching" Version="$(SystemRuntimeCachingVersion)" />
<PackageReference Include="BenchmarkDotNet" Version="$(BenchmarkDotNetVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
</ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions tools/props/VersionsNet8OrLater.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Net8 project dependencies -->
<PropertyGroup>
<SystemConfigurationConfigurationManagerVersion>8.0.0</SystemConfigurationConfigurationManagerVersion>
<SystemRuntimeCachingVersion>8.0.0</SystemRuntimeCachingVersion>
</PropertyGroup>
</Project>
10 changes: 3 additions & 7 deletions tools/specs/Microsoft.Data.SqlClient.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ When using NuGet 3.x this package requires at least version 3.4.</description>
<dependency id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="6.35.0" />
<dependency id="Microsoft.IdentityModel.JsonWebTokens" version="6.35.0" />
<dependency id="Microsoft.SqlServer.Server" version="1.0.0"/>
<dependency id="System.Configuration.ConfigurationManager" version="6.0.1" exclude="Compile" />
<dependency id="System.Diagnostics.DiagnosticSource" version="6.0.1" exclude="Compile" />
<dependency id="System.Runtime.Caching" version="6.0.0" exclude="Compile" />
<dependency id="System.Text.Encoding.CodePages" version="6.0.0" exclude="Compile" />
<dependency id="System.Text.Encodings.Web" version="6.0.0" />
<dependency id="System.Configuration.ConfigurationManager" version="8.0.0" exclude="Compile" />
<dependency id="System.Diagnostics.DiagnosticSource" version="8.0.0" exclude="Compile" />
<dependency id="System.Runtime.Caching" version="8.0.0" exclude="Compile" />
</group>
<group targetFramework="net6.0">
<dependency id="Microsoft.Data.SqlClient.SNI.runtime" version="5.2.0-preview1.23340.1" exclude="Compile" />
Expand All @@ -60,8 +58,6 @@ When using NuGet 3.x this package requires at least version 3.4.</description>
<dependency id="Microsoft.SqlServer.Server" version="1.0.0"/>
<dependency id="System.Configuration.ConfigurationManager" version="6.0.1" exclude="Compile" />
<dependency id="System.Runtime.Caching" version="6.0.0" exclude="Compile" />
<dependency id="System.Text.Encoding.CodePages" version="6.0.0" exclude="Compile" />
<dependency id="System.Text.Encodings.Web" version="6.0.0" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="Microsoft.Data.SqlClient.SNI.runtime" version="5.2.0-preview1.23340.1" exclude="Compile" />
Expand Down

0 comments on commit c8b70f1

Please sign in to comment.