Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/315.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.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# 使用在WCF服务中使用的dll中声明的类_C#_Wcf_Dll - Fatal编程技术网

C# 使用在WCF服务中使用的dll中声明的类

C# 使用在WCF服务中使用的dll中声明的类,c#,wcf,dll,C#,Wcf,Dll,我有这样的架构:客户端=>wcf服务=>dll 在dll中,我有类Err 在wcf服务中,我有方法Err getsmth() 在客户端中,我尝试使用: ServiceReference1.Err result=wcfclient.getsmth(); 服务引用1上出现“未找到”错误。错误已过期 如何使dll类在客户端可见?我不想在客户端上复制类代码。找到了它。 我必须将[ServiceKnownType(typeof(Err))]设置为OperationContract

我有这样的架构:客户端=>wcf服务=>dll

在dll中,我有类Err

在wcf服务中,我有方法Err getsmth()

在客户端中,我尝试使用:

ServiceReference1.Err result=wcfclient.getsmth();
服务引用1上出现“未找到”错误。错误已过期

如何使dll类在客户端可见?我不想在客户端上复制类代码。

找到了它。 我必须将[ServiceKnownType(typeof(Err))]设置为OperationContract