Open derkyjadex opened 2 months ago
That is a very old SDK version..
That is a very old SDK version..
Not sure how the versioning works for the build SDK, but that's the latest available on nuget.org and is only 2 months old.
???
`
The SDK version is correct - we are on 0.2.0-preview
dotnet publish in the Microsoft.Build.Sql SDK is not being implemented to run Sqlpackage/dacfx publish, we plan to converge on the csproj publish behavior (#447)
The /Profile:
parameter on sqlpackage publish should assist here: https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-publish?view=sql-server-ver16
dotnet build
sqlpackage /a:publish /sourcefile:bin/Debug/yourproject.dacpac /profile:test.publish.xml
if you don't have sqlpackage:
dotnet tool install -g microsoft.sqlpackage
Steps to Reproduce:
test.sqlproj
andtest.publish.xml
:dotnet build
dotnet msbuild -t:SqlPublish -p:SqlPublishProfilePath=test.publish.xml
Expected outcome
The database should be published to the configured server.
Actual outcome
The command fails with the following output:
Running in Linux gives the same results.
Did this occur in prior versions? If not - which version(s) did it work in?
Same results from 0.1.19-preview and 0.1.15-preview. Not tested with earlier versions.
Workarounds
This does work as expected when directly calling the MSBuild installed with Visual Studio (ie. exactly the same command but without the
dotnet
prefix). Obviously that is not available outside Windows and is a much bigger pre-requisite even then.The
Publish
target fails with a different error, as reported in https://github.com/microsoft/DacFx/issues/447. With the VS MSBuild, both theSqlPublish
andPublish
targets work as expected.