C#smo项目程序集未引用错误

Oli*_*ham 1 c# sql-server assemblies smo

我正在做一个使用smo对象(服务器,数据库)的C#项目.
包括我

using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Server;  
Run Code Online (Sandbox Code Playgroud)

我添加了Microsoft.SqlServer.Management.Smo,Microsoft.SqlServer.Management.SmoExtended,Microsoft.SqlServer.SqlEnum,Microsoft.SqlServer.ConnectionInfo.

但我仍然得到这样的错误(10个错误类似于此):

The type 'Microsoft.SqlServer.Management.Sdk.Sfc.ISfcHasConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'.  
Run Code Online (Sandbox Code Playgroud)

怎么解决这个?

Jus*_*ony 7

好吧,我认为错误是相当解释的,包括对引用Microsoft.SqlServer.Management.Sdk.Sfc.您尚未列出添加该引用的列表.有时,当您添加使用未包含的其他dll引用的引用时,您必须包含其他引用...即使您不使用它们.