Skip to content

Commit 3ea4a94

Browse files
committed
refactor(sdk): tie SqlPackageVersion to DacFxVersion
- Move hardcoded DacFx version to Sdk.props - Reference $(DacFxVersion) in DacpacTool.csproj - Set SqlPackageVersion from DacFxVersion in Sdk.targets - Ensures SDK owns versioning and keeps DacFx and SqlPackage in sync
1 parent 0da2f63 commit 3ea4a94

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/DacpacTool/DacpacTool.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Microsoft.SqlServer.DacFx" Version="170.2.70" />
15+
<PackageReference Include="Microsoft.SqlServer.DacFx" Version="$(DacFxVersion)" />
1616
<PackageReference Include="NuGet.Versioning" Version="6.14.0" />
1717
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
1818
<PackageReference Include="System.CommandLine.NamingConventionBinder" Version="2.0.0-beta4.22272.1" />

src/MSBuild.Sdk.SqlProj/Sdk/Sdk.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<MSBuildAllProjects Condition="'$(MSBuildToolsVersion)' != 'Current'">$(MSBuildAllProjects);$(MsBuildThisFileFullPath)</MSBuildAllProjects>
1111
<SqlServerVersion>Sql150</SqlServerVersion>
1212
<TargetExt>.dacpac</TargetExt>
13+
<DacFxVersion>170.2.70</DacFxVersion>
1314
</PropertyGroup>
1415

1516
<PropertyGroup>

src/MSBuild.Sdk.SqlProj/Sdk/Sdk.targets

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,11 @@
321321
<ContainerImageName Condition="'$(ContainerImageName)'==''">$([System.String]::Copy('$(MSBuildProjectName)').ToLowerInvariant().Trim())-publisher</ContainerImageName>
322322
<ContainerImageTag Condition="'$(ContainerImageTag)'==''">$([System.String]::Copy('$(Configuration)').ToLowerInvariant().Trim())</ContainerImageTag>
323323

324-
<!-- Passed to the Dockerfile as build-arg SQLPACKAGE_VERSION -->
325-
<SqlPackageVersion>170.2.70</SqlPackageVersion>
324+
<!--
325+
Passed to the Dockerfile as build-arg SQLPACKAGE_VERSION.
326+
Using DacFxVersion which is set in Sdk.props so that we keep DacFx and SqlPackage in sync
327+
-->
328+
<SqlPackageVersion>$(DacFxVersion)</SqlPackageVersion>
326329

327330
<!-- Local staging area for the project dacpac and referenced dacpacs -->
328331
<ContainerStagingDir>$(MSBuildProjectDirectory)\.container</ContainerStagingDir>

0 commit comments

Comments
 (0)