问题
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".
回答1:
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.
回答2:
I have a Visual Studio 2015 solution with database and SSIS projects. At some point publishing the database project stopped working as described above.
I closed all open tabs in the solution, and then was able to publish the database successfully.
回答3:
I had the same problem and the suggestions to close all the tabs worked for me, but that sucks. So, when I got the problem, I started closing tabs one at a time and found that for me, closing tabs related to Azure storage (blob containers, download status) let me publish again.
回答4:
And for me, under VS 2017, the solution was Rebuild
ing the DB project
来源:https://stackoverflow.com/questions/38771193/visual-studio-database-project-fails-to-publish-no-error-messages