4

I'm getting this error when using sqlpackage.exe, or the DacFx DLLs, to programmatically publish a dacpac (A), compiled and provided by a different team, which in turn has a dependency on another dacpac (B).

I can confirm that:

  • The reference to B from A has the "Suppress Reference Warnings" to True
  • The B .dacpac file is in the same folder as the A .dacpac file
  • I have tried with 2 different versions of Microsoft.SqlServer.Dac.dll, 12.0.2882.1 and 14.0.3881.1
  • Both dacpacs have the setting to target SQL Server 2012, and I am attempting to publish to SQL Server 2012
  • I have tried both with the IncludeCompositeObjects deploy options set to true, and to false

What am I doing wrong? How can I publish a dacpac that has been compiled and provided to me, which has a database reference that is referenced with a path that is invalid for me?

Simon Green
  • 1,131
  • 1
  • 10
  • 28

1 Answers1

4

This can occur when you switch between editions of Visual Studio. In my scenario, I originally built a database project using VS2017 Professional Edition. When I switched to VS2017 Enterprise Edition, I received a bunch of The reference to external elements from the source named 'master.dacpac' could not be resolved, because no such source is loaded. errors on build (it also occurs when building in Enterprise first, then switching to Professional).

I resolved this as follows:

  • Close Visual Studio;
  • Delete the *.dbmdl, *.jfm and *.user files in the project root folder;
  • Re-open Visual Studio and re-build.
robyaw
  • 2,274
  • 2
  • 22
  • 29