WPF Visual Studio Package gives error: Could not find endpoint element with name 'WCFname' and contr

Posted by Andrei on Stack Overflow See other posts from Stack Overflow or by Andrei
Published on 2010-05-17T12:17:36Z Indexed on 2010/05/17 12:20 UTC
Read the original article Hit count: 589

Hi everybody.

This error has been covered before in other questions, however not for a Visual Studio package.

Could not find endpoint element with name 'WCFname' and contract 'WCFcontract' in the ServiceModel client configuration section.

I have a VS package project that needs to connect to a WCF service that provides some functionality. I add a reference to the WCF service and Visual Studio automatically creates the content for the configuration file.

config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="WSHttpBinding_IWCFSearchService" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Message">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            algorithmSuite="Default" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:8732/Design_Time_Addresses/WCFSearchServiceLibrary/Service1/"
                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IWCFSearchService"
                contract="WCFSearchServiceReference.IWCFSearchService" name="WSHttpBinding_IWCFSearchService">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>
</configuration>

However, when I run the application (in VS experimental mode) it doesn't seem to take the provided configuration file (app.config). Everytime it just throws this error:

Could not find endpoint element with name 'WSHttpBinding_IWCFSearchService' and contract 'WCFSearchServiceReference.IWCFSearchService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.

My guess is that it's taking the configuration file for Visual Studio (since it is running VS experimental mode). So yeah...why isn't it recognizing the app.config file and how could I make the application to recognize it? Any help would be very welcomed as I have already tried to fix this for some time.

Thanks.

© Stack Overflow or respective owner

Related posts about visual-studio-2010

Related posts about visual-studio-package