Search code examples
c#.netvisual-studiovisual-studio-2022

How to fix SQL database publishing just stopping to work with VS22


What was the problem?

So my team and I encountered an issue with Visual Studio 2022 v17.9.0 where we were no longer able to publish our database projects via the the *.publish.xml files:

It would build the database project but the Data Tool Operations tab that usually contains information on the progress of the publishing action would stay completely blank. However, it seems to have entered publishing mode, as we received an error message when trying to leave VS that the solution could not be closed while publishing.

These projects are build-projects based on .NET 4.7.2 targetted at Microsoft Azure SQL Databases that use these *.publish.xml files to publish the database to a target database.

What have we tried?

This was reproducible on our release state that didn't have these issues before, so it was not related to any change in the solution that we did.

It was also encountered by multiple team members on different machines, so a local issue also seemed unlikely.

We also tried searching for solutions online but only found generic troubleshooting recommendations like reinstalling VS.


Solution

  • What was the solution?

    In the end, one of our team members found out that closing all open document tabs in VS would allow us to publish again.

    What caused the problem?

    We haven't encountered this issue before upgrading VS but cannot pinpoint the exact version where this appeared. Also, which document constellation exactly caused the problem, we cannot tell at this point since it is now mitigated.

    If we do encounter it again and/or figure out more, I will update this post.