{"id":644,"date":"2009-01-08T20:42:14","date_gmt":"2009-01-09T01:42:14","guid":{"rendered":"http:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/644"},"modified":"2009-01-08T20:42:14","modified_gmt":"2009-01-09T01:42:14","slug":"annoying-c-web-exception","status":"publish","type":"post","link":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/644","title":{"rendered":"Annoying C# Web Exception …"},"content":{"rendered":"
\n

System.Net.WebException<\/p>\n

The request was aborted: The request was canceled.<\/p>\n

Cannot close stream until all bytes are written.<\/p>\n<\/blockquote>\n

If you\u2019re getting that exception, make sure that the timeout for the webrequest is set sufficiently to handle the request. The default as of .NET 3.5 SP1 seems to be 100 seconds. I\u2019m working on an fix to SnugUp<\/a> and discovered that large files would throw the exception above. I thought it must be a problem on the SmugMug side, but couldn\u2019t come up with a rational reason why it would just fail with my application \u2026 and then it dawned on me that it was closing the stream early because it had exceeded the timeout! <\/p>\n

So, if you\u2019ve seen that exception, and can\u2019t figure it out \u2026 consider checking the timeout. (Also, verify the content-length is set properly \u2013 that\u2019s another reason this exception might be thrown).<\/p>\n","protected":false},"excerpt":{"rendered":"

System.Net.WebException The request was aborted: The request was canceled. Cannot close stream until all bytes are written. If you\u2019re getting that exception, make sure that the timeout for the webrequest is set sufficiently to handle the request. The default as of .NET 3.5 SP1 seems to be 100 seconds. I\u2019m working on an fix to […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[4],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pd5QIe-ao","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":388,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/388","url_meta":{"origin":644,"position":0},"title":"Silverlight Weather Demonstration","date":"June 26, 2008","format":false,"excerpt":"Demonstration available here. (You'll need to wait for a moment while it loads the first time). I've created a reasonably simple, yet multi-technology (and discipline) demonstration using Silverlight for the user interface and ASP.NET as the back-end. The demonstration uses: Silverlight 2.0 Data binding Delayed downloading of images \"Web services\"\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2008\/06\/image21.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1559,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1559","url_meta":{"origin":644,"position":1},"title":"Some code from SnugUp.Browser (an album browser for SmugMug)","date":"March 6, 2012","format":false,"excerpt":"I\u2019ve been doing some tinkering recently with SmugMug again. Through testing SnugUp for the past 4 years, I\u2019ve made quite the mess of my SmugMug account. Literally hundreds of poorly organized and often completely junk albums. I\u2019ve been wanting to clean it up, but SmugMug\u2019s UI for that is so\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2012\/03\/image_thumb.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2224,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/2224","url_meta":{"origin":644,"position":2},"title":"Flutter Demo application linking to BoardGameGeek.Com’s Hot Game List","date":"February 26, 2018","format":false,"excerpt":"I've built a slightly more interesting application using Flutter.\u00a0 Using an XML feed from BoardGameGeek's API, the application displays a list of the current hot games complete with thumbnail images. Here's the code. I used a standard Flutter app template and also added a few packages to the project. I've\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"Hulk Smash Layout","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2018\/02\/2018-02-26-19_45_39-Hulk-Smash-Meme-Generator-Imgflip.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":217,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/217","url_meta":{"origin":644,"position":3},"title":"The ASP.NET Single Page Interface and AJAX Patterns","date":"May 9, 2008","format":false,"excerpt":"Posted on MSDN, by Dino Esposito, \"Single Page Interface and AJAX Patterns.\" What is it? From the article... Single-Page Interface Model To take full advantage of AJAX, you need to have all of your features, or at least most of them, in a single page. This is known as the\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":285,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/285","url_meta":{"origin":644,"position":4},"title":"Source Analysis for C# Released From Microsoft","date":"May 23, 2008","format":false,"excerpt":"From Microsoft.... Source Analysis is similar in many ways to Microsoft Code Analysis (specifically FxCop), but there are some important distinctions. FxCop performs its analysis on compiled binaries, while Source Analysis analyzes the source code directly. For this reason, Code Analysis focuses more on the design of the code, while\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":633,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/633","url_meta":{"origin":644,"position":5},"title":"A Silverlight 2 TilePanel","date":"December 14, 2008","format":false,"excerpt":"You may notice that the Silverlight TileBrush is missing some key properties which would enable it to actually tile a brush. The WPF TileBrush has properties such as TileMode, Viewbox, and ViewportUnits that can be used to tile an image as a fill or as a background for a UIElement.\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2008\/12\/image1.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts\/644"}],"collection":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/comments?post=644"}],"version-history":[{"count":0,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts\/644\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/media?parent=644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/categories?post=644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/tags?post=644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}