I recently installed the 4.5 framework on our development web server, which runs IIS 7.5 on Windows Server 2008. After installation, the two web services started to have the same error. These web services were created using the MS REST starter kit. Here is the error I am getting.
The binding instance is already associated with a listening URI. If two endpoints want to use the same ListenUri, they must also use the same instance of the binding object. Two conflicting endpoints were either specified in the AddServiceEndpoint () calls, or in the configuration file, or in combination with AddServiceEndpoint () and configuration.
Here is a copy of the system.service model section of our configuration file.
<system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> <bindings> <webHttpBinding> <binding> <security mode="Transport" /> </binding> </webHttpBinding> <wsHttpBinding> <binding name="EnterpriseIdentityBinding" 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="TransportWithMessageCredential"> <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default" /> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="https://betaapps/EnterpriseIdentity/V1/UserService.svc" binding="wsHttpBinding" bindingConfiguration="EnterpriseIdentityBinding" contract="UserServiceWCF.IUserService" name="wsSecureUsers" /> <endpoint address="https://betaapps/EnterpriseIdentity/V1/RoleService.svc" binding="wsHttpBinding" bindingConfiguration="EnterpriseIdentityBinding" contract="RoleServiceWCF.IRoleService" name="wsSecureRoles" /> </client> <standardEndpoints> <webHttpEndpoint> <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true"/> </webHttpEndpoint> </standardEndpoints> <behaviors> <serviceBehaviors> <behavior> <serviceAuthorization principalPermissionMode="Custom"> <authorizationPolicies> <add policyType="Hsmv.Web.Security.IdentityModel.HttpContextWithRolesPolicy, Hsmv.Web.Security" /> </authorizationPolicies> </serviceAuthorization> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel>
Any idea why this error occurred after installing .Net 4.5?
I would like to add that I tried to delete this section, and it works without it.
<webHttpBinding> <binding> <security mode="Transport" /> </binding> </webHttpBinding>
I use this because this service runs on ssl. I heard that WCF 4.5 is trying to create bindings and endpoints for you, so they don't have to be in web.config. So I wondered if this section is automatically created by WCF automatically and is not needed. Or is my thinking wrong? Thanks!
source share