sqlEnum not found

本文关键字:found not sqlEnum | 更新日期: 2023-09-27 17:55:31

我正在使用一些sql服务器依赖项in a console app

Imports Microsoft.SqlServer.Management.Common
Imports Microsoft.SqlServer.Management.Smo

当我在没有安装 sql 服务器的情况下在服务器上运行时,我遇到了此错误:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or ass
embly 'Microsoft.SqlServer.SqlEnum, Version=11.0.0.0, Culture=neutral, PublicKey
Token=89845dcd8080cc91' or one of its dependencies. The system cannot find the f
ile specified.

sqlEnum not found

继续在您的项目文件夹中提供您包含的库。并将它们嵌入到您的项目中。(不是"程序文件"文件夹中的那些)

DLL 应位于:C:''Program Files''Microsoft SQL Server''100''SDK''Assemblies

(或 C:''Program Files (x86)''Microsoft SQL Server''100''SDK''Assemblies on 64 位系统)。

您至少需要添加以下 DLL:

  • Microsoft.SqlServer.ConnectionInfo.dll
  • Microsoft.SqlServer.Smo.dll
  • Microsoft.SqlServer.Management.Sdk.Sfc.dll
  • Microsoft.SqlServer.SqlEnum.dll

否则,您可以将 SQLServer Compact Edition 用于您的项目,以获得功能齐全的安装程序。