Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.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
C# 缺少using指令或程序集引用OperationContext_C#_Directive - Fatal编程技术网

C# 缺少using指令或程序集引用OperationContext

C# 缺少using指令或程序集引用OperationContext,c#,directive,C#,Directive,在我的c#windows窗体中,它有一个错误 找不到类型或命名空间名称“OperationContext”(是 是否缺少using指令或程序集引用?) 有人能解释一下原因吗???是在库文件System.ServiceModel.dll中包含的程序集System.ServiceModel中定义的类 如果试图使用此类,则需要通过添加对库的引用,然后添加 using System.ServiceModel; 在文件中使用OperationContext,因为您没有添加用于访问此类的dll 阅读 您必

在我的c#windows窗体中,它有一个错误

找不到类型或命名空间名称“OperationContext”(是 是否缺少using指令或程序集引用?)

有人能解释一下原因吗???

是在库文件
System.ServiceModel.dll
中包含的程序集
System.ServiceModel
中定义的类

如果试图使用此类,则需要通过添加对库的引用,然后添加

using System.ServiceModel;

在文件中使用OperationContext

,因为您没有添加用于访问此类的dll

阅读


您必须添加System.ServiceModel dll

谢谢您,我的朋友们,它工作正常,对我的知识有好处:-)我希望记住您,如果您觉得答案有帮助,接受这个答案是礼貌的。