Visual Studio database project fails to publish, no error messages

Giles Roberts picture Giles Roberts · Aug 4, 2016 · Viewed 9k times · Source

I have several database projects in the same solution. They all fail to publish. My Visual Studio version is Enterprise 2015. My SQL Server version is 12.0.4459.0.

The projects used to publish correctly on my machine. They publish correctly on my co-workers machines. I've not changed the database projects from the correctly publishing versions on my co-workers machines.

The steps I use to publish are as follows:

  • I right click and select publish.
  • I load the publish profile from the xml file.
  • I click publish.

What I'd expect to happen: The Data Tools Operations window is displayed and the project publishes successfully.

What actually happens: The Data Tools Operations window is not displayed. On switching to the Data Tools Operations window it is empty. The project is not published. Visual Studio subsequently operates normally apart from when it is closed. On closing Visual Studio a dialog is displayed saying "The solution cannot be closed while publishing".

Answer

Giles Roberts picture Giles Roberts · Aug 5, 2016

Edit: The old answer below worked for me once but was intermittent on subsequent occasions. I then noticed that I was actually getting an error displayed in the bottom left hand corner of Visual Studio:

Exception from HRESULT: 0x80041FE2 The tab has been closed.

Searching on the above returned this article: https://connect.microsoft.com/VisualStudio/feedback/details/827417/vs-express-2013-cannot-reopen-any-open-file-tabs-and-silently-closes-them-on-selection

So I closed all my open tabs and was then able to publish.

Old answer: To resolve this issue after clicking Publish, instead of clicking Load Profile I clicked Edit and browsed to the database server. I then clicked Test connection. The test connection came back successful. I then clicked Load Values for my SQLCMD variables. On clicking Publish, the database project published successfully.

After following the above steps, I was then able to publish again by my usual method of clicking Load Profile on the Publish Database dialog.