1

I'm able to run the WCF-SecureProfile sample that comes with the MSFT WCF samples download (http://msdn.microsoft.com/en-us/library/ee818238.aspx)

However I can't port this server component to IIS. I get the error that <MakeConnectionBindingElement/> can't be loaded. Considering that I have the behavior extensions loaded I don't know why IIS can't see the extension, however the self-host version of my app can.enter image description here

I uploaded the sourcecode of the project into codeplex for easy browsing. Here is a direct link to web.config and all other files.

enter image description here2

makerofthings7
  • 60,103
  • 53
  • 215
  • 448
  • Try making the behaviorExtensions add element not refer to a specific version of the MakeConnectionChannel.DLL like so: – Sixto Saez May 09 '11 at 17:40
  • No, WCF configuration extension types must be fully qualified! – larsw May 09 '11 at 18:01
  • Sorry to disagree with @larsw but the type reference **doesn't** need to be fully qualified. To prove it to yourself, take the sample solution referred to the URL in this question and modify the service project app.config as shown in my comment. The service will work just fine :) – Sixto Saez May 09 '11 at 18:09
  • Ah, they finally did the proper change in WCF 4.0; http://connect.microsoft.com/wcf/feedback/details/216431/wcf-fails-to-find-custom-behaviorextensionelement-if-type-attribute-doesnt-match-exactly I hadn't noticed that, thanks. – larsw May 09 '11 at 18:14
  • Sorry, I should have mentioned this is a WCF 4 thing. I too was bitten by the required fully qualified assembly reference in WCF 3 when we first set up our continuous integration server and it automatically versioned all the assemblies it deployed. – Sixto Saez May 09 '11 at 18:21
  • @Sixto - Editing the Type didn't fix the issue of locating the assembly – makerofthings7 May 09 '11 at 21:02
  • Are you sure you added a reference to the MakeConnectionChannel project to the new web host project (check if MakeConnectionChannel.DLL is in the bin folder of the web site) and that you haven't changed any namespaces in the sample solution? I was able to use the sample solution projects just fine after adding a WCF Application project and making the required changes to the web.config file after fixing the issue I found in my answer. – Sixto Saez May 09 '11 at 21:12
  • @Sixto - I took the copy on my HD, and created a new web project. No name spaces were changed. The default service project works fine.. no issues. I uploaded the project to codeplex inline above – makerofthings7 May 09 '11 at 21:46
  • I took a quick look and didn't see anything that stood out. I'll compare your uploaded solution tomorrow when I get in with the one I got working. – Sixto Saez May 09 '11 at 23:36
  • @Sixto - I got it working... Thanks for your help! I'll use this WCF namespace to upload an Azure compatible (multi node) instance. – makerofthings7 May 10 '11 at 02:17

1 Answers1

1

I got the sample and set it up to run on IIS local. I didn't get the same issue as the one in this question but I did run into a big gotcha. Accessing the service in IIS gave me this error message:

Contract requires Duplex, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it.

After some head scratching, I found the cause of this issue. WCF 4 now assigns default bindings to each transport (I'm liking this feature less & less). For the HTTP transport, the default binding is basicHttpBinding. The problem is the customBinding config does not override any default binding. This causes WCF to attempt to configure duplex over basicHttpBinding which of course isn't supported. The fix is to turn off the default transport mapping for HTTP and assign it to your custom binding as shown below for this service:

    <protocolMapping>
        <clear/> <!-- removes all defaults which you may or may not want. -->
        <!-- If not, use <remove scheme="http" /> -->
        <add scheme="http" binding="customBinding" bindingConfiguration="rspBinding"/>
    </protocolMapping>

Once I added this to the serviceModel element, the IIS based service worked just fine.

makerofthings7
  • 60,103
  • 53
  • 215
  • 448
Sixto Saez
  • 12,610
  • 5
  • 43
  • 51