Geeks With Blogs

News ASP.net Forms Justin Hoffman
Justin Hoffman March 2011 Entries
WCF HttpClient Error calling a RESTful WCF Service - Cannot write more bytes to the buffer than the configured maximum buffer size: 65536
Using the HttpClient API from wcf.codeplex.com, you may encounter this error if respones are too large. Cannot write more bytes to the buffer than the configured maximum buffer size: 65536 In order to increase the size of the Response Buffer, just increase the MaxReseponseContentBufferSize as shown below. Increase it to something larger than the default: 65536 depending on your response sizes. var client = new HttpClient { MaxResponseContentBufferSize = 196608, BaseAddress = new Uri("http://myservice/servi... ......

Posted On Friday, March 4, 2011 1:10 PM

Using T4 to generate Configuration classes
I wanted to try to use T4 to read a web.config and generate all of the appSettings and connectionStrings as properties of a class. I elected in this template only to output appSettings and connectionStrings but you can see it would be easily adapted for app specific settings, bindings etc. This allows for quick access to config values as well as removing the potential for typo's when accessing values from the ConfigurationManager. One caveat: a developer would need to remember to run the .tt file ......

Posted On Wednesday, March 2, 2011 8:56 AM

Copyright © Justin Hoffman | Powered by: GeeksWithBlogs.net