Akhil Achuthan
Akhil Achuthan

Reputation: 53

Can't get file path of Microsoft.SqlServer.Management.Dac in C# visual studio for reference

I've got the following code:

DacStore dacStore = new DacStore(ServerConnection connection);
databaseName = sqlConnection.Database;
var dacInstance = dacStore.DacInstance[databaseName];

An error happens in using DacStore due to the lack of reference library files. I need the file path of the corresponding library.

Upvotes: 2

Views: 2791

Answers (2)

Steven Green
Steven Green

Reputation: 3507

DacStore is a component of the older version of DAC that shipped with SQL Server 2008 R2. That entire API was replaced by DAC v3 in SQL Server 2012. If you're looking for DAC v3, then Ed's answer is correct. But if you're looking for Microsoft.SqlServer.Management.Dac.dll, that's a bit different. Look here for the download: http://www.microsoft.com/en-us/download/details.aspx?id=24000

Or on a machine with the SQL Server 2008 R2 management tools installed, check C:\Program Files (x86)\Microsoft SQL Server\100\SDK\Assemblies or the GAC.

Upvotes: 0

Ed Elliott
Ed Elliott

Reputation: 6856

It moves about depending on which version of the dacfx you have installed, common places are:

  • C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin
  • C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin
  • C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin
  • C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120

When I create a solution in visual studio, I tend to create a Libs dir and copy the daccfx dll's in there and check them in so everyone can get them wherever they are.

Upvotes: 2

Related Questions