【发布时间】:2009-07-02 15:32:51
【问题描述】:
我正在一个紧凑的框架项目中使用线程,并且代码如下所示。当我尝试进入 StartThreads() 时,会引发 NotSupportedException。这似乎有点奇怪,为什么在调用 StartThreads() 的行上会抛出异常而不是在内部,CF 不支持什么?我认为它的 ThreadStart.BeginInvoke 但这不是实际引发异常的地方。
void SomeMethod()
{
this.StartThreads(); // <- NotSupportedException is thrown here, I can't step into this method with the debugger
}
void StartThreads()
{
ThreadStart threadStart = BeginDoStuff;
threadStart.BeginInvoke(EndDoStuff, null);
}
【问题讨论】:
标签: c# .net multithreading compact-framework