4

我正在使用Microsoft Reactive ExtensionsTask.Parallel中的类(.NET 3.5 库,而不是 .NET 4 中的类,因为我的应用程序在 3.5 上运行)。在 .NET 上一切正常,但是当我在 Mono(Linux 上为 2.10.5)中运行它时,调用该方法时会引发异常:Parallel.For()

System.Threading.Tasks.TaskSchedulerException: TaskSchedulerException_ctor_DefaultMessage 
 ---> System.EntryPointNotFoundException: SwitchToThread
 at (wrapper managed-to-native) System.Threading.Platform:SwitchToThread ()
 at System.Threading.Platform.Yield () [0x00000] in <filename unknown>:0
 at System.Threading.ManualResetEventSlim.Wait (Int32 millisecondsTimeout, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0
 at System.Threading.ManualResetEventSlim.Wait () [0x00000] in <filename unknown>:0
 at System.Threading.Tasks.Task.InternalRunSynchronously (System.Threading.Tasks.TaskScheduler scheduler) [0x00000] in <filename unknown>:0
 --- End of inner exception stack trace ---
 at System.Threading.Tasks.Task.InternalRunSynchronously (System.Threading.Tasks.TaskScheduler scheduler) [0x00000] in <filename unknown>:0
 at System.Threading.Tasks.Task.RunSynchronously (System.Threading.Tasks.TaskScheduler scheduler) [0x00000] in <filename unknown>:0
 at System.Threading.Tasks.Parallel.ForWorker[Object] (Int32 fromInclusive, Int32 toExclusive, System.Threading.Tasks.ParallelOptions parallelOptions, System.Action`1 body, System.Action`2 bodyWithState, System.Func`4 bodyWithLocal, System.Func`1 localInit, System.Action`1 localFinally) [0x00000] in <filename unknown>:0

我在网上找不到任何涵盖此异常的资源,所以我有点卡住了。有什么建议么?3.5 的任务并行库是否在 Mono 上运行?

4

0 回答 0