Why does the SqlPublish target not work for a SQL Server 2014 database project?

My machine has the current version (SSDT, Visual Studio 2012 Professional and SQL Server 2014 Developer) (March 2014). I have a SQL Server project (let it be called MyProject.sqlproj) that targets SQL Server 2014. I tried to do the following:

MsBuild.exe MyProject.sqlproj 
            /t:SqlPublish /p:SqlPublishProfilePath=Somewhere.publish.xml

This fails with the following error:

Deployment Error Expand 72002: Internal error.
A database platform service of type Microsoft.Data.Tools.Schema.Sql.Sql120DatabaseSchemaProvider is not valid. You must ensure that the service is loaded, or you must provide the fully qualified type name of the actual database platform service.

If I switch this project to the target year 2012 (and point to the 2012 instance), the same command will be successfully executed. I previously asked a potentially related question, and the answer there solved my problem, but that is not the problem here - I can successfully post this 2014 DACPAC if I use it SqlPackage.exedirectly.

What is happening and how can I fix it?

+4
source share
1 answer

The problem here is that the VisualStudioVersion environment variable is not set, in which case the .sqlproj file currently defaults to version VS2010 (which does not support SQL Server 2014). Calling "set VisualStudioVersion = 11.0" before starting MSBuild will fix the problem.

+4

Source: https://habr.com/ru/post/1545425/


All Articles