Examples on how to use via app.config file

Nov 19, 2008 at 12:00 PM

I noticed that your sample code builds up connections completely in code. Do you have any samples of how to configure the WCF Extensions via an app.config file?

Nov 20, 2008 at 2:30 AM

I have uploaded a zip to the patches page that contains a sample service and client both configured using app.config

Nov 22, 2008 at 1:22 PM

Thanks, I started to take a look at it today.  Perhaps you can refer me to a good WCF resource though. The app.config that was crafted for me with VS 2008 contains "behaviors" and "services". The sample you uploaded contains "bindings" and "clients".

Are they compatible? Can a behavior or service use your binding or do I need a "behaviorExtensions" section instead?

Thanks in advance,
Nov 27, 2008 at 11:23 PM
Duh. I finally realized I was looking at the wrong app.config and that's why it didn't make any sense.

OK, I am now getting the following error:
The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 21546.

But I am unsure how to set this for the the customBinding. I see how and where to set it for the standard binding, but not for the custom one.

Anyone have any insight on this?

Thanks in advance,

Nov 27, 2009 at 1:12 PM

It turns out that one needs to indicate some max values on the <customBinding> element in the app.config as follows - in my case I set the max's to 2GB, which I kinda figured should be sufficient for most cases ;-):


        <binding name="myBinding">
            <readerQuotas maxDepth="1024"
          <httpTransport maxReceivedMessageSize="2147483647" />

Do this on both the client and the server.


Apr 3, 2010 at 10:08 AM

Hi! Can this be used with non .NET clients as well? I mean, I have a solution that includes the client implemented on a Linux hand-held device and I am using c/gSoap for the client.