MSBuild.Sdk.SqlProj: SQLPackage publish is not working in linux, dacpac built with sqlproject have absolute path to referenced dacpacs

Hello,

I am trying to use sqlpackage publish to deploy a dacpac created by MSBuild.Sdk.SqlProj and having issues with the absolute path. details…

I have a csProj sql project that references another DACPAC as a nuget.

this is the nuget reference line from the project

<PackageReference Include="SomeDBDacpacPackageName" Version="5.84.0" DacpacName="SomeDB"></PackageReference> I copy the two dacpacs from the bin folder after building the cs project file.

The files are coppied into a docker linux session and I cd to that directory and call sqlpackage.

/tmp/sqlpackage/sqlpackage /Action:Publish /TargetServerName:localhost /TargetDatabaseName:SomeDB /TargetUser:TargetUser /TargetPassword:TargetPassword /SourceFile:My.DatabaseDacpac.dacpac /p:ScriptDatabaseOptions=false /TargetTrustServerCertificate:true /rp:/tmp/dacpacs/EDB/Libraries/SomeDb.dacpac

I have tried with and without /rp, doesn’t help.

#9 14.12 Initializing deployment (Start) #9 14.82 *** No file was supplied for reference SomeDB.dacpac; deployment might fail. When package was created, the original referenced file was located C:\Users\UserName.nuget\packages\SomeDBDacpacPackageName\5.84.0/tools/SomeDB.dacpac. #9 14.82 Initializing deployment (Failed) #9 15.83 *** An error occurred during deployment plan generation. Deployment cannot continue. #9 15.83 Error SQL0: The reference to external elements from the source named ‘SomeDB.dacpac’ could not be resolved, because no such source is loaded. fail. When package was created, the original referenced file was located C:\Users\UserName.nuget\packages\SomeDBDacpacPackageName\5.84.0/tools/SomeDB.dacpac. #9 14.02 Initializing deployment (Failed) #9 15.24 *** An error occurred during deployment plan generation. Deployment cannot continue. #9 15.24 Error SQL0: The refere

Is there anyway to get the csproj to build with relative paths? has anyone successfully deployed in linux with a dacpac that references another dacpac? If so how?

Thanks for your time

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 29

Most upvoted comments

@jmezach @JLLange A fix for this was included in the next version of DacFX 162.4 - so will be included in next version of this SDK

@bheemvennapureddy Please create a new issue with a full runnable repro project attached.

@JLLange Are you able to provide a repro of this, then I will investigate