<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.silverlight.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Report a Silverlight Bug</title><link>http://forums.silverlight.net/forums/28.aspx</link><description>Found a bug in Silverlight? Use this forum to describe the bug and the code or steps to reproduce it.</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Re: Re: HttpWebRequest infinite loop handling error 301: Moved Permanently</title><link>http://forums.silverlight.net/forums/thread/138981.aspx</link><pubDate>Fri, 28 Nov 2008 10:53:18 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:138981</guid><dc:creator>andulvar</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/138981.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=28&amp;PostID=138981</wfw:commentRss><description>&lt;p&gt;I followed the code in one of the examples in the Silverlight documentation.&amp;nbsp; The fact that your test did not reproduce the error only tells us that you don&amp;#39;t have a representative test.&amp;nbsp; I can tell you with absolute certainty that the request is being retried.&amp;nbsp; I ran the web server in a debugger and watched the requests as they arrived.&amp;nbsp; A single call to BeginGetResponse generates multiple web server hits, and they will repeat indefinitely so long as the web server continues to respond with 301.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: HttpWebRequest infinite loop handling error 301: Moved Permanently</title><link>http://forums.silverlight.net/forums/thread/138816.aspx</link><pubDate>Fri, 28 Nov 2008 03:19:29 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:138816</guid><dc:creator>Jonathan Shen – MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/138816.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=28&amp;PostID=138816</wfw:commentRss><description>&lt;p&gt;Hi Andulvar,&lt;/p&gt;&lt;p&gt;We conducted a 301 error from the target website and added this kind of the test code to see whether your issue can be reproduced. &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(new Uri(&amp;quot;http://localhost:61928/Default.aspx&amp;quot;));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wr.BeginGetResponse(result =&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HttpWebResponse hwr = (HttpWebResponse)wr.EndGetResponse(result);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //add a break point here&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, wr);&lt;/b&gt; &lt;/p&gt;&lt;p&gt;It works as desired and not like your description.&amp;nbsp; For the asynchronous request, please f&lt;a href="http://msdn.microsoft.com/en-us/library/system.net.webrequest.begingetresponse.aspx"&gt;ollow this sample&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Best regards,&lt;/p&gt;&lt;p&gt;Jonathan &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>HttpWebRequest infinite loop handling error 301: Moved Permanently</title><link>http://forums.silverlight.net/forums/thread/135725.aspx</link><pubDate>Sat, 22 Nov 2008 14:44:24 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:135725</guid><dc:creator>andulvar</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/135725.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=28&amp;PostID=135725</wfw:commentRss><description>&lt;p&gt;I am using the asynchronous read capability of HttpWebRequest, like this:&lt;/p&gt;&lt;pre class="coloredcode"&gt;        &lt;span class="kwd"&gt;private void&lt;/span&gt; ReadHandler(&lt;span class="kwd"&gt;object&lt;/span&gt; userdata)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwd"&gt;object&lt;/span&gt;[] args = (&lt;span class="kwd"&gt;object&lt;/span&gt;[])userdata;&lt;br /&gt;            HttpWebRequest w = (HttpWebRequest)args[0];&lt;br /&gt;            RequestState req = (RequestState)args[1];&lt;br /&gt;            IAsyncResult result = w.BeginGetResponse(&lt;span class="kwd"&gt;new&lt;/span&gt; AsyncCallback(RespCallback), req);&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;&amp;nbsp;This works fine, unless the requested URL does not exist.&amp;nbsp; If the web server returns &amp;quot;404: Not Found&amp;quot;, then the &amp;quot;RespCallback&amp;quot; is called and the call completes.&amp;nbsp; &lt;/p&gt;&lt;p&gt;However, if the web server returns &amp;quot;301: Moved Permanently&amp;quot; then the RespCallback is never called and the Silverlight application modifies the URL and repeats the request forever.&amp;nbsp; The sequence of requests as received by the web server looks like this:&lt;/p&gt;&lt;p&gt;The correct request comes first:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;GET /Silverlight/Controls/TripleGauge.xaml?_sldummy=06f631f4-0527-4ec6-875a-013a5c576566 HTTP/1.1&lt;br /&gt;Accept: */*&lt;br /&gt;UA-CPU: x86&lt;br /&gt;Accept-Encoding: gzip, deflate&lt;br /&gt;User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)&lt;br /&gt;Host: developers.cogentrts.com:8088&lt;br /&gt;Connection: Keep-Alive&lt;/p&gt;&lt;p&gt;The first re-request.&amp;nbsp; Notice that the arguments have been stripped and a / added to the URL.&amp;nbsp; This is just plain wrong.&amp;nbsp; The arguments are a necessary part of the URL.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;GET /Silverlight/Controls/TripleGauge.xaml/ HTTP/1.1&lt;br /&gt;Accept: */*&lt;br /&gt;UA-CPU: x86&lt;br /&gt;Accept-Encoding: gzip, deflate&lt;br /&gt;User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)&lt;br /&gt;Host: developers.cogentrts.com:8088&lt;br /&gt;Connection: Keep-Alive&lt;/p&gt;&lt;p&gt;Now a second / has been added to the URL and the arguments are still missing. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;GET /Silverlight/Controls/TripleGauge.xaml// HTTP/1.1&lt;br /&gt;Accept: */*&lt;br /&gt;UA-CPU: x86&lt;br /&gt;Accept-Encoding: gzip, deflate&lt;br /&gt;User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)&lt;br /&gt;Host: developers.cogentrts.com:8088&lt;br /&gt;Connection: Keep-Alive&lt;br /&gt;&lt;/p&gt;&lt;p&gt;All subsequent requests look like the third one.&amp;nbsp; This repeats forever.&lt;/p&gt;&lt;p&gt;Since 301 is a permanent error, why is Silverlight making any repeated calls at all?&amp;nbsp; &lt;/p&gt;&lt;p&gt;Even if you can explain the re-try, why is it stripping the arguments, thereby potentially generating a completely different response page?&lt;/p&gt;&lt;p&gt;Why is it looping forever with the same URL?&amp;nbsp; Isn&amp;#39;t the definition of insanity &amp;quot;repeating the same thing over and over, and expecting a different result&amp;quot;? &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>