Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t获取C#visual studio中Microsoft.SqlServer.Management.Dac的文件路径以供参考_C#_Visual Studio 2012_Dacpac - Fatal编程技术网

Can';t获取C#visual studio中Microsoft.SqlServer.Management.Dac的文件路径以供参考

Can';t获取C#visual studio中Microsoft.SqlServer.Management.Dac的文件路径以供参考,c#,visual-studio-2012,dacpac,C#,Visual Studio 2012,Dacpac,我有以下代码: DacStore dacStore = new DacStore(ServerConnection connection); databaseName = sqlConnection.Database; var dacInstance = dacStore.DacInstance[databaseName]; 由于缺少参考库文件,在使用DacStore时发生错误。我需要相应库的文件路径。它会根据您安装的dacfx版本进行移动,常见位置有: C:\ProgramFiles(x8

我有以下代码:

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

由于缺少参考库文件,在使用DacStore时发生错误。我需要相应库的文件路径。

它会根据您安装的dacfx版本进行移动,常见位置有:

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

当我在visual studio中创建解决方案时,我倾向于创建一个Libs dir并复制其中的daccfx dll,然后将其签入,这样每个人都可以在任何地方获取它们。

DacStore是SQL Server 2008 R2附带的旧版本DAC的一个组件。在SQL Server 2012中,整个API被DAC v3取代。如果您正在寻找DAC v3,那么Ed的答案是正确的。但是,如果您正在查找Microsoft.SqlServer.Management.Dac.dll,则情况会有所不同。请点击此处下载:

或者在安装了SQL Server 2008 R2管理工具的计算机上,检查C:\Program Files(x86)\Microsoft SQL Server\100\SDK\Assembly或GAC。

Google“下载SQL Server dac框架”以找到适合您的服务器版本的框架。