Execute a WebRequest in a Background thread while UI Thread is blocked

后端 未结 2 1119
暖寄归人
暖寄归人 2021-01-25 03:37

Why does the following code executes WebRequests after 5 secs when the UI Thread isn\'t being blocked anymore? Thread.Sleep is in the UI Thread while both Instantia

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-25 04:04

    I asked almost the exact same question here (which I'll close now that I found yours): DownloadStringAsync requires UI thread?

    The answer is that ALL network code is ultimately marshaled to the UI thread in Silverlight before version 5. Unfortunately, even when I build against Silverlight 5, I'm still getting the same issue, so I'm still investigating...

提交回复
热议问题