microsoft/DacFx

Unexpected failure when publishing using SqlPackage: Object reference not set to an instance of an object

rpmrmartin opened this issue · 0 comments

  • SqlPackage or DacFx Version: 162.4.92
  • .NET Framework (Windows-only) or .NET Core: .NET 8.0.400
  • Environment (local platform and source/target platforms): Windows 11 23H2 publishing to SQL Server 2019 CU 28

Steps to Reproduce:

  1. Publish a dacpac using the following command: sqlpackage /Action:Publish '/SourceFile:C:\Users\rmartin\rpm\RPM34\Config\database\RpmSubscriber\bin\Release\RpmSubscriber.dacpac' '/TargetConnectionString:<redacted>' /Variables:GlobalServer=Test34 /Variables:RpmGlobal=RpmGlobal '/Profile:C:\Users\rmartin\rpm\RPM34\Config\database\RpmSubscriber\RpmSubscriber.publish.xml' /Properties:BlockOnPossibleDataLoss=False
  2. Get the following output from SqlPackage:

Publishing to database '<redacted>' on server 'TEST34'.
Initializing deployment (Start)
Initializing deployment (Failed)
Time elapsed 0:00:32.37
*** An unexpected failure occurred: Object reference not set to an instance of an object..

  1. SqlPackage exits with code 1

Publishing to an empty database works fine, but immediately republishing to the same database (now containing the objects in our project) gives the error above. I can't share the dacpac I'm trying to publish publicly but I can share it privately with contributors to this repo.

Did this occur in prior versions? If not - which version(s) did it work in?

No. Used to work in SqlPackage 162.3.566 and 162.2.111