Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8488647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:36:01+00:00 2026-06-10T21:36:01+00:00

MonoTouch advertises support for AsParallel on its website with this code snippet: from item

  • 0

MonoTouch advertises support for AsParallel on its website with this code snippet:

from item in items.AsParallel ()
   let result = DoExpensiveWork (item)
   select result;

However, even a trivial sample crashes my app:

 var items = new [] { 1, 2, 3 };
 var twice = (
        from x in items.AsParallel()
        select 2 * x
    ).ToArray();

System.ExecutionEngineException has been thrown. Attempting to JIT compile method 'System.Linq.Parallel.QueryNodes.WrapHelper:<Wrap<code>1>m__4A<int>(System.Collections.Generic.IEnumerator</code>1<int>)' while running with --aot-only.

I know MonoTouch can’t handle virtual generic methods but isn’t PLINQ supposed to work?
What is it wrong that I am doing?

MonoTouch version is 5.3.5.

Same goes for Parallel.ForEach:

System.AggregateException: One or more errors occured ---> System.Exception:
Attempting to JIT compile method 'System.Threading.Tasks.Parallel:<ForEach`1>m__36<int> ()' while running with --aot-only.
See http://docs.xamarin.com/ios/about/limitations for more information.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T21:36:03+00:00Added an answer on June 10, 2026 at 9:36 pm

    This is a known limitation with MonoTouch and generics – in this case it’s because you’re working with structures.

    It should work if you use objects instead:

    var items = new object [] { 1, 2, 3 };
    var twice = (
        from x in items.AsParallel()
        select 2 * x
    ).ToArray();
    

    We’re working on fixing some of these limitations, so it would be nice if you could file a bug report with a sample project for us to have a look to see if it is possible to actually fix this case on day.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

An older version of MonoTouch added the following code from its template. Is this
This Monotouch code below will not cause an exception, but it also won't show
Monotouch 5.0.2. Running the simple code below I get this in the output panel:
I am building a Monotouch application which downloads data from the server encrypted using
When i first started using monotouch i found a page with some code samples
Monotouch compiles the app into the native code. How can Apple know that the
In MonoTouch, we ran into this problem with the Movie Player sample in that
The MonoTouch documentation states that it doesn't support virtual generic methods. However, in my
Any MonoTouch Solution I create has this issue, If I make any change to
MonoTouch.UIKit.UIKeyboard.BoundsFromNotification(MonoTouch.Foundation.NSNotificaton)] was deprecated in iOS 3.2 . Is there a simple replacement method/snippet I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.