asp.net - WCF - More than one endpoint configuration for that contract was found - Error -
we have working asp.net web application wcf. wcf service hosted windows service. fine. made change service contract have different namespace (from namespace1.iservicecontract namespace2.iservicecontract). after change deployed server , getting following error when try instantiate service object.
system.invalidoperationexception: endpoint configuration section contract 'namespace2.iservicecontract' not loaded because more 1 endpoint configuration contract found. please indicate preferred endpoint configuration section name. generated: fri, 06 jul 2012 21:02:56 gmt system.web.httpunhandledexception: exception of type 'system.web.httpunhandledexception' thrown. ---> system.invalidoperationexception: endpoint configuration section contract 'namespace2.iservicecontract' not loaded because more 1 endpoint configuration contract found. please indicate preferred endpoint configuration section name. @ system.servicemodel.description.configloader.lookupchannel(string configurationname, string contractname, boolean wildcard) @ system.servicemodel.description.configloader.loadchannelbehaviors(serviceendpoint serviceendpoint, string configurationname) @ system.servicemodel.channelfactory.applyconfiguration(string configurationname, configuration configuration) @ system.servicemodel.channelfactory.applyconfiguration(string configurationname) @ system.servicemodel.channelfactory.initializeendpoint(string configurationname, endpointaddress address) @ system.servicemodel.channelfactory`1..ctor(string endpointconfigurationname, endpointaddress remoteaddress) @ system.servicemodel.endpointtrait`1.createsimplexfactory() @ system.servicemodel.endpointtrait`1.createchannelfactory() @ system.servicemodel.clientbase`1.createchannelfactoryref(endpointtrait`1 endpointtrait) @ system.servicemodel.clientbase`1.initializechannelfactoryref() @ system.servicemodel.clientbase`1..ctor() @ testapplication.managementwrapper.verifyauthentication(int32 appid, string token) @ testapplication.verifyauthentication(string tokenstring)
we did research issue , found type if exception shows if have 2 client endpoints defined in our web.config file. have 1 client endpoint defined. more on exception shows in server. local works fine. here our service model:
<system.servicemodel> <bindings> <nettcpbinding> <binding name="nettcpbinding_management" closetimeout="00:01:00" opentimeout="00:01:00" receivetimeout="00:10:00" sendtimeout="00:01:00" transactionflow="false" transfermode="buffered" transactionprotocol="oletransactions" hostnamecomparisonmode="strongwildcard" listenbacklog="10" maxbufferpoolsize="4194304" maxbuffersize="2147483647" maxconnections="10" maxreceivedmessagesize="2147483647"> <readerquotas maxdepth="32" maxstringcontentlength="2147483647" maxarraylength="2147483647" maxbytesperread="32768" maxnametablecharcount="2147483647" /> <reliablesession ordered="true" inactivitytimeout="00:10:00" enabled="false" /> <security mode="none" /> </binding> </nettcpbinding> </bindings> <client> <endpoint address="net.tcp://servername:9010/management/service/managementservice" binding="nettcpbinding" bindingconfiguration="nettcpbinding_management" contract="namespace2.iservicecontract" name="nettcpbinding_iservicecontract" /> </client> </system.servicemodel>
we tried restart iis , application pool. still getting same exception.
try searching web.config using web address managementservice. also, search web.config reference old namespace (contract="namespace1.iservicecontract"). don't forget check .config files. little gotcha has burned me before.
Comments
Post a Comment