Reputation: 1591
I am trying to publish an SSDT project and it is throwing an error "Object reference not set to an instance of an object" No other message, is there a way to troubleshoot this.
Upvotes: 4
Views: 2586
Reputation: 71
I had the same error and it was because of the build configuration.
The SSDT was missing the current solution build config. After adding it via Configuration Manager to the SSDT it worked again.
Upvotes: 5
Reputation: 3578
I got this error when right-clicking on a DB project and selecting Publish..
(although nothing was showing at all in the Data Tools Operation window, unlike OP)
I built the project, then Publish...
started working again :)
Using SQL Server Data Tools 15.1.61810.11040
Upvotes: 2
Reputation: 21
I ran into this issue yesterday and discovered the root cause this morning through trial and error.
For me, this was caused by SSDT attempting to update a partition scheme and function. It tries to do this by dropping and recreating the partition scheme and function but it obviously can't do this while they are being used. As a result, it fails to generate the upgrade script with the dreadfully unhelpful error above.
If you don't need to update the partitioning (i.e. if you have something else managing it), you can disable the check in the advanced publish settings:
As shown in the description above, this should ignore any changes to the partition schemes and functions when running the comparison, but still deploy them initially. This resolves the error during script generation.
If you need to update the partition scheme/function, I would recommend doing so as a post-deploy script so that you have better control over the code being executed.
Upvotes: 1
Reputation: 29
What version of SSDT do you have?
This issue was fixed in our most recent sprint, so the latest version of SSDT should unblock you.
https://learn.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt
Upvotes: 0
Reputation: 15658
I have seen that along with "target unavailable", and downloading and installing the latest SSDT from here usually fix the issue. Make sure your project target is SQL Azure Database as explained here.
Upvotes: 1