C# 在.Net 4.6中找不到UdpBinding
我有一个奇怪的错误。我想在.NET4.6项目中以编程方式使用UdpBinding。我可以在App.Config中添加它,Wcf配置也提供了创建UdpBinding的可能性。但是当我尝试在代码中使用UdpBinding时,这是行不通的。System.ServiceModel不提供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
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