Search code examples
visual-studio-2013sql-server-2008-r2xml-namespacesdatabase-projectdacpac

Issue deploying dacpac on SQL Server 2008 R2 created using VS13 Database Project


I have a Database Project in Visual Studio 2013 which I use to create a dacpac file and deploy it on SQL Servers using SQL Server Management Studio. I can successfully deploy the dacpac on SQL Server 2012 but when I try to deploy it on SQL Server 2008 R2, I get the following error message when selecting the DAC package:

<DacType xmlns='http://schemas.microsoft.com/sqlserver/dac/Serialization/2012/02'> was not expected. (es3ttafd)

I have selected "SQL Server 2008" as Target Platform under Project Settings but this does not seem to modify the namespace. When I unpack the dacpac, I can see that this namespace exists inside DacMetadata.xml, model.xml and Origin.xml files.

Is there anything I can do to stop including that namespace in the dacpac (or change it to the correct one?) in order to allow me to deploy it on an SQL Server 2008? I can successfully publish the project through VS on the SQL Server but I want to be able to create a dac package and deploy it on other servers as well, using the wizard.

Thanks.


Solution

  • I suspect that you're using an old version of SQL Server Management Studio to deploy to SQL Server 2008. I'd suggest downloading the latest SSMS (available here: https://msdn.microsoft.com/en-us/library/mt238290.aspx) and using that to publish.

    Alternately, the most recent version of the Data-Tier Application Framework (available here: https://www.microsoft.com/en-us/download/details.aspx?id=53876) includes SqlPackage.exe, which can be used to publish a dacpac file, like so:

    SqlPackage.exe /a:publish /tcs:"Data Source=SERVER;Initial Catalog=DBNAME;Integrated Security=true" /sf:C:\project\mydb.dacpac
    

    See documentation for SqlPackage.exe here: https://msdn.microsoft.com/en-us/library/hh550080(v=vs.103).aspx