I've been successfully publishing DACPACs to SQL Server 2008-2012 instances using SqlPackage.exe, as installed by SQL Server Data Tools (and typically found in C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin
). However, in attempting to publish a 2014-targeted DACPAC to a SQL Server 2014 instance using this same SqlPackage.exe, I get the following:
*** Could not deploy package.
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.
I've found minimal info regarding this; the closest I have found is was a problem publishing to Azure.
I've kept up to date with SSDT patches but would guess that the SqlPackage.exe I have (which shows an 11.0.2902.0 version) is simply incompatible. I am able to publish to this same instance using Visual Studio 2012's Publish command so the instance itself does not seem to be the issue.
Is there a newer version of SqlPackage available that would support publishing a 2014 DACPAC to a 2014 server? Or another scriptable way to do this?
Yes, there is a new version supporting SQL Server 2005-2016 available and it installs into a different location than the previous (SQL Server 2012 and lower) version. In fact, you'll have different install locations depending on if you just use SSDT or if you install it as part of SSMS or the standalone installer.
SSDT installs the Dac DLLs inside Visual Studio in the latest releases. This is to avoid side by side issues (Visual Studio 2012 vs 2013 vs SSMS) that required all to be updated to use the latest code.
- If you have updated to the latest SSDT, you'll find SqlPackage.exe and the related DLLs in the VS Install Directory\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130. For VS2013 the VS install directory is C:\Program Files (x86)\Microsoft Visual Studio 12.0, and it's 14.0 for VS2015.
SQL Server Management Studio (SSMS) and the standalone Dac Framework MSI both install to the system-wide location. This is C:\Program Files (x86)\Microsoft SQL Server\130\Dac\bin.
There is now an official Microsoft.Data.Tools.Msbuild NuGet package that contains SqlPackage.exe and a blog post with the details:
This NuGet package contains all the required components to build and publish SQL Projects (.sqlproj). This supports continuous integration and continuous deployment scenarios – SQL Projects can be built on a local build agent without installing the full Visual Studio or SQL Server Data Tools (SSDT) products.
SSDT installs the Dac DLLs inside Visual Studio in the latest releases. This is to avoid side by side issues (Visual Studio 2012 vs 2013 vs SSMS) that required all to be updated to use the latest code. If you have updated to the latest SSDT, you'll find SqlPackage.exe and the related DLLs in the VS Install Directory\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130. For VS2013 the VS install directory is C:\Program Files (x86)\Microsoft Visual Studio 12.0, and it's 14.0 for VS2015. SQL Server Management Studio (SSMS) and the standalone Dac Framework MSI both install to the system-wide location. This is C:\Program Files (x86)\Microsoft SQL Server\130\Dac\bin.
**Ans of Mr. Kevin Cunnane. is a right process but if the database in sql2016 use 140\dac **
来源:https://stackoverflow.com/questions/23375748/publish-dacpac-to-sql-server-2014-using-sqlpackage-exe