![](/img/trans.png)
[英]In Visual Studio's Designer, why don't any images show up in the Select Resource window?
[英]Why don't my Tasks show in the Visual Studio Tasks window?
我正在使用以下代码创建一些任务:
private Task PollSomething()
{
return Task.Run(
async () =>
{
while (!_cts.Token.WaitHandle.WaitOne(200))
{
var result = await _channel.DoSomethingAsync();
DoSomethingWithResult(result);
}
if (_cts.IsCancellationRequested)
throw new TaskCanceledException();
}, _cts.Token);
}
当我测试代码时,一切都按预期工作,但是当我在调试器中运行代码时,无法使用“任务”窗口(以前称为“并行任务”窗口)可视化任务。 我可以看到线程很好。
是什么导致任务不可见?
PS我正在使用R#测试运行程序和NUnit来执行此操作。
原来有一个Visual Studio设置:“使用托管兼容模式”可以解决此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.