Build | Correct references to Microsoft.SqlServer.Server in Visual Studio builds#4003
Build | Correct references to Microsoft.SqlServer.Server in Visual Studio builds#4003edwardneal wants to merge 5 commits intodotnet:mainfrom
Conversation
| <Exec Command="powershell.exe -NonInteractive -executionpolicy Unrestricted ^ | ||
| -command "&$(ToolsDir)scripts\downloadLatestNuget.ps1 -nugetDestPath '$(NuGetRoot)'"" /> | ||
| <Exec Command="$(NuGetCmd) pack -Symbols -SymbolPackageFormat snupkg $(ToolsDir)specs\Microsoft.Data.SqlClient.nuspec -Version $(MdsPackageVersion) -OutputDirectory $(PackagesDir) -properties "COMMITID=$(CommitId);Configuration=$(Configuration);ReferenceType=$(ReferenceType);AbstractionsPackageVersion=$(AbstractionsPackageVersion);LoggingPackageVersion=$(LoggingPackageVersion)"" /> | ||
| <Exec Command="$(NuGetCmd) pack -Symbols -SymbolPackageFormat snupkg $(ToolsDir)specs\Microsoft.Data.SqlClient.nuspec -Version $(MdsPackageVersion) -OutputDirectory $(PackagesDir) -properties "COMMITID=$(CommitId);Configuration=$(Configuration);ReferenceType=$(ReferenceType);AbstractionsPackageVersion=$(AbstractionsPackageVersion);LoggingPackageVersion=$(LoggingPackageVersion);SqlServerPackageVersion=$(SqlServerPackageVersion)"" /> |
There was a problem hiding this comment.
I think there are some YAML pipeline files that don't use this target, and call nuget pack directly. They will need this new property added to them as well.
There was a problem hiding this comment.
Thanks @paulmedynski - I think I've caught them all.
| Refer to the SqlServer package via project or package reference | ||
| depending on our build parameters. | ||
| --> | ||
| <ItemGroup Condition="'$(ReferenceType)' == 'Project' and '$(TargetFramework)' != 'net462'"> |
There was a problem hiding this comment.
Hmmm... I wonder why we don't use our SqlServer package for .NET Framework. I guess the types are included, but then why does SqlServer target net46?
There was a problem hiding this comment.
I think the idea is that netstandard2.0 is the normal version (which includes the IBinarySerialize interface et al), and on net462 it simply type forwards to the full Framework - so a netstandard2.0 library which references the package will continue to work even in a netfx environment.
|
I'll trigger the pipelines once you add the SqlServer version to the several place the YAML needs it. |
Description
This follows up my previous PR - I can't currently build via Visual Studio. Upon trying to do so, the net8.0, net9.0 and net10.0 targets for ManualTests fail with the error:
The versioning for Microsoft.SqlServer.Server is also wrong because the package is versioned independently of SqlClient and its associated libraries, but this doesn't break the build - and more importantly, threading the package-specific versions into Microsoft.SqlServer.Server just changes the version in the error message:
Converting netcore's unconditional PackageReference into the newer style of PackageReference/ProjectReference fixes this problem.
Just to neaten up the version numbers and dependencies, we then return to Microsoft.SqlServer.Server and bring the build configuration into the same style as the Abstractions project file, adding the various version-related properties and making sure that these are threaded into the nuspec.
Issues
None.
Testing
Visual Studio builds from scratch. build.proj continues to function properly, setting correct dependencies on Microsoft.SqlServer.Server. I can continue to execute UDT-based tests in ManualTests, so the updated DLL loads properly.