Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/20.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# 在.Net 4.6中找不到UdpBinding_C#_.net_Wcf - Fatal编程技术网

C# 在.Net 4.6中找不到UdpBinding

C# 在.Net 4.6中找不到UdpBinding,c#,.net,wcf,C#,.net,Wcf,我有一个奇怪的错误。我想在.NET4.6项目中以编程方式使用UdpBinding。我可以在App.Config中添加它,Wcf配置也提供了创建UdpBinding的可能性。但是当我尝试在代码中使用UdpBinding时,这是行不通的。System.ServiceModel不提供UdpBinding的定义 using System; using System.ServiceModel; namespace WcfServiceLibraryTest { public class Serv

我有一个奇怪的错误。我想在.NET4.6项目中以编程方式使用UdpBinding。我可以在App.Config中添加它,Wcf配置也提供了创建UdpBinding的可能性。但是当我尝试在代码中使用UdpBinding时,这是行不通的。System.ServiceModel不提供UdpBinding的定义

using System;
using System.ServiceModel;

namespace WcfServiceLibraryTest
{
    public class ServiceTest : IServiceTest
    {
        private UdpBinding _binding; //throw: CS0246  WCF C# The type or namespace name could not be found (are you missing a using directive or an assembly reference?)
    }
}
所有必要的东西实际上都被引用了


谢谢你的回答。

我找到了解决办法。我必须通过添加引用来引用System.ServiceModel.Channels