rr-wfm / MSBuild.Sdk.SqlProj

An MSBuild SDK that provides similar functionality to SQL Server Data Tools (.sqlproj) projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Referencing MSSQL master dacpacs no longer accurate

sloncho opened this issue · comments

It appears that MS have changed and split the dackpacks in 2 separate projects. Using the current readme instructions fails to publish.

The old nuget packages are removed: https://www.nuget.org/packages/Microsoft.SqlServer.Dacpacs

Using the new one restored the functionality: https://www.nuget.org/packages/Microsoft.SqlServer.Dacpacs.Master

Ref (change): microsoft/DacFx#266

@sloncho Thanks for the heads-up. I think we'll only need to update our docs, but don't need to make any code changes for this. Feel free to send a PR with the updated docs if you're up for it, otherwise I'll do it when I get around to it (which might be a while ;)).

@jmezach I'll do that, but I'm not sure if it is only docs. With the new structure, they place only single dacpac in the tools folder. The current implementation of the sdk still requires the use of DacpacName="master" attribute in the project reference, otherwise it does not work. That attribute looks like redundant when there is only one file. Does that need to change?

The SDK does support not specifying DacpacName attribute, but that only works if the .dacpac file has the same name as the package itself. As the package is named Microsoft.SqlServer.Dacpacs.Master and the filename is master.dacpac that is not going to work. I guess we could try to figure out the name of the .dacpac automagically, but frankly I'm not sure if it is worth it.

It appears that I was too fast to report "it is working". It appears that there is a problem using the new nuget package from MS.:

  1. If used w/o the "DacpacName" (what I reported "working"):
    • it builds and deploys
    • VS still reports the warnings - meaning it did not get the file, as the name is not specified. So it was "not" working.
  2. If DacpacName=master
    • VS does not report error
    • deploy fails with EXEC : error : An unknown error occurred while deploying database 'MyDb': Object reference not set to an instance of an object.

The error happens both with 2.5.0 and 2.6.0 of the sdk, using dotnet sdk 6.0 and 7.0. The nuget package I use is v.150, as this is the server version we use.

This starts to look like a bug (here or in the MS nuget). Unfortunately, I'm not well equipped to debug this. Any pointers?