Rediģēt

Kopīgot, izmantojot


Alter DacFx used by SQL Server Data Tools (SSDT)

Under specific circumstances you might need to use a different version of DacFx with the SQL Server Data Tools interface in Visual Studio. When possible, it is recommended to use a standalone version of DacFx if an alternative version from SQL Server Data Tools is required.

Follow the process below to alter the version of DacFx used by SQL Server Data Tools (SSDT).

Replace DacFx files in SSDT

SQL Server Data Tools stores the DacFx files under Common7\IDE\Extensions\Microsoft\SQLDB\DAC within the Visual Studio program files. For Visual Studio 2022 Community, the full path is commonly C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Microsoft\SQLDB\DAC.

Substitution should be done within the same major version of DacFx. For example, if Visual Studio 17.9 (2022) utilizes DacFx version 162.2.33.1, only other 162.x versions should be used. To view the current version, select Microsoft.SqlServer.Dac.dll file in File Explorer from the SSDT DacFx folder and use the context menu to open the file properties.

DacFx is published to NuGet. Identify the desired version within the Microsoft.SqlServer.DacFx NuGet feed and follow these steps to use it with SSDT:

  1. Download the NuGet package for the DacFx version from the web interface.

  2. Change the nupkg file to a zip file and extract the archive.

  3. Close Visual Studio.

  4. Copy the following files from lib/net462 into the SSDT DacFx folder:

    • Microsoft.Data.Tools.Schema.Sql.dll
    • Microsoft.Data.Tools.Utilities.dll
    • Microsoft.SqlServer.Dac.dll
    • Microsoft.SqlServer.Dac.Extensions.dll
    • Microsoft.SqlServer.Dac.Extensions.xml
    • Micrososft.SqlServer.Dac.xml
    • Microsoft.SqlServer.TransactSql.ScriptDom.dll
    • Microsoft.SqlServer.Types.dll

SQL Projects will require Clean or Rebuild after this process to properly incorporate the replaced DacFx version.