Deploy database project from cmd error Deploy72002 in Visual Studio Database Project

Few days ago I have faced up with a problem during publishing the database project created in Visual Studio 2012 for SQL Server 2014 directly from windows command line. I am not the  only one that got the error Deploy72002 error. You can find the very useful article here: https://msdn.microsoft.com/en-us/library/hh550080(v=VS.103).aspx and on the web you can find some blogs that describe the problem as well. But the provided solution didn’t work for me. Here is the source of the problem.

But after executing the command we have the following error:

The error message is quite different than the source of the problem. It turns out that we can get this error when we have multiple installation of Visual Studio and/or multiple installation of SQL Server. The answer to this problem is simple, but not obvious reading the error message. We need to just pass to the msbuild the Visual Studio version that we want to use with the command. In my case the correct command was:

Now, I was able to run and publish my database using cmd.

Leave a Comment

Your email address will not be published. Required fields are marked *