Customizing WCF Binding Custom Behavior Using a .config File - Why Doesn't It Work?

I am trying to insert custom behavior into my service client, following the example here.

I seem to follow all the steps, but I get a ConfigurationErrorsException . Is there anyone more experienced than me who can determine what I'm doing wrong?

Here is the whole app.config file.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <behaviors>
            <endpointBehaviors>
                <behavior name="ClientLoggingEndpointBehaviour">
                    <myLoggerExtension />
                </behavior>
            </endpointBehaviors>
        </behaviors>
        <extensions>
            <behaviorExtensions>
                <add name="myLoggerExtension"
                     type="ChatClient.ClientLoggingEndpointBehaviourExtension, ChatClient, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"/>
            </behaviorExtensions>
        </extensions>
        <bindings>
        </bindings>
        <client>
            <endpoint
                behaviorConfiguration="ClientLoggingEndpointBehaviour"
                name="ChatRoomClientEndpoint"
                address="http://localhost:8016/ChatRoom"
                binding="wsDualHttpBinding"
                contract="ChatRoomLib.IChatRoom"
                />
        </client>
    </system.serviceModel>
</configuration>

Here is the error message:

system.serviceModel/: 'myLoggerExtension' . , system.serviceModel//behaviorExtensions. : (C:\Documents \ \ \Visual Studio 2008\Projects\WcfPractice\ChatClient\Bin\Debug\ChatClient.vshost.exe.config 5)

, ClientLoggingEndpointBehaviourExtensionobject, , .

+3
2

, . , , .NET, WCF .

, ClientLoggingEndpointBehaviourExtension AssemblyQualifiedName , .config.

, ​​ WCF. (. ) -, .NET 4.0.

. .

0

, , , : , .

-Oisin

0

Source: https://habr.com/ru/post/1747789/


All Articles