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.
1 "drive:location/msbuild.exe" /t:Publish /p:SqlPublishProfilePath="drive:location/name.publish.xml" "drive:locationname.sqlproj
But after executing the command we have the following error:
1 drive:locationname.publish.sql : Deploy error Deploy72002: Internal Error. The database platform service with type Microsoft.Data.Tools.Schema.Sql.Sql120DatabaseSchemaProvider is not valid. You must make sure the service is loaded, or you must provide the full type name of a valid database platform service. [drive:locationname.sqlproj]
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:
1 "drive:location/msbuild.exe" /t:Publish /p:SqlPublishProfilePath="drive:location/name.publish.xml" "drive:locationname.sqlproj" /p:VisualStudioVersion=12.0
Now, I was able to run and publish my database using cmd.
Latest posts by sdrzymala (see all)
- WordPress blog analysis in Power BI - May 1, 2016
- Power BI Desktop. An error while changing the name in Power Query - April 30, 2016
- Microsoft SQL Server Data Types – why this is so important? - April 30, 2016