简体   繁体   中英

WCF CommunicationException: understanding the root cause

I am writing an application that connects to the WCF service. When I receive CommunicationException on the client side I need to understand whether the problem is on the service side or due to the invalid client configuration.

You can add the following section to your WCF host config file:

<system.diagnostics>
        <sources>
            <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
                <listeners>
                    <add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="logs\WCFLog.svclog"/>
                </listeners>
            </source>
        </sources>
    </system.diagnostics>

this will create an svclog file which can give you more information about the cause of the connection problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM