Silverlight + Weclient.DownloadStringAsync + IE = issue
I have an asp.net MVC server on one side and a silverlight 4 client on the other. In the Silverlight app I create a separate thread that regularly polls the server for an event. I am using firefox and so far it is working well.
At some point I used Internet Explorer 8 (and 9). When the Silverlight app is used under this browser, the thread sends the request to the server and gets the answer. Then the subsequent requests have an issue. The DownloadStringAsync is called but the server never receives the request (I have some logging there). The DownloadStringCompleted event handler is instantaneously called with Error=false and no exc开发者_开发问答eption. Strangely enough, e.Result is non empty and exactly the same than for the first request.
I also realized that when using IE on my development machine where the server also runs (therefore sending requests to localhost) then I have no issue.
Any idea?
Update: my gut feeling is now that the response is cached by Silverlight. Since I use the same URL then the same content is returned. I just need to find a way to turn off the cache. Since I have access to the server, I would like to do it on that side. I don't know yet how to do that but will search inside the asp.net MVC caching mechanisms or http headers.
Applying a cache attribute like explained here solved it (at least with recent versions of IE. I don't know for older ones).
精彩评论