DACPAC won't deploy because 'can't connect to server'?

前端 未结 2 684
北荒
北荒 2020-12-19 04:13

I\'m trying to deploy a DACPAC to LocalDB 2012 but it\'s just not having it:

Stack trace is as follows:

==================================

Could not         


        
相关标签:
2条回答
  • 2020-12-19 04:58

    Updating to the latest version of SSMS should fix this. It's available here: https://msdn.microsoft.com/en-us/library/mt238290.aspx

    Otherwise, please confirm that the version of LocalDB you're using is LocalDB 2012. To do this you can run this query against the server:

    select @@version
    
    • 11.0.xxxx = SQL Server 2012
    • 12.0.xxxx = SQL Server 2014
    • 13.0.xxxx = SQL Server 2016

    The library that handles dacpac deployment is called the data-tier application framework, or DacFX. The version of DacFX used by SSMS 2012 is installed in:

    C:\program files (x86)\Microsoft Sql Server\110\DAC\bin
    

    Note the "110" in the path, indicating that the version of DacFX supports up to SQL Server 2012. SSMS 2014 looks for DacFX in a similar path, but in the 120 folder, and that version of DacFX supports up to SQL Server 2014, and so on.

    When DacFX is asked to deploy to a server version that's newer than what is supports, it will give the "Cannot connect" error message. (The error message has been improved in newer versions of DacFX, by the way).

    At one point in time, Visual Studio used the version of DacFX installed in the above path, but around the time that SQL Server 2014 support was released in the SQL Server tools, a change was made and Visual Studio got its own copy of DacFX under

    C:\program files (x86)\Microsoft Visual Studio XX.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120
    

    So this is how you can get different behavior between different versions of Visual Studio and SSMS.

    0 讨论(0)
  • 2020-12-19 05:12

    I had the same problem and it was fixed by changing the executable folder from "C:\program files (x86)\Microsoft Sql Server\110\DAC\bin" to "C:\program files (x86)\Microsoft Sql Server\120\DAC\bin"

    Thanks, Chandana

    0 讨论(0)
提交回复
热议问题