MalHamburg
MalHamburg

Reputation: 11

UdpBinding not found in .Net 4.6

I have a strange error. I want to use UdpBinding programmatically in my .Net 4.6 project. I can add it in App.Config and Wcf Configuration also offers the possibility to create UdpBinding. But when I try to use UdpBinding in the code, that does not work. System.ServiceModel simply does not provide a definition for 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?)
    }
}

Everything that is necessary is actually referenced.

Thanks for the answer.

Upvotes: 0

Views: 152

Answers (1)

MalHamburg
MalHamburg

Reputation: 11

I have found the solution. I had to reference System.ServiceModel.Channels extra via Add Reference.

Upvotes: 1

Related Questions