I have a problem in a Portable Class Library class. It seems I cannot use .AsParallel()
extension method although System.Linq
is referenced. Here is the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PortableClassLibrary1
{
public class Class1
{
public Class1()
{
var list = new List<String>();
}
}
}
list
hasn't AsParallel()
method, it has only AsQueryable
and AsEnumerable
.
Target frameworks are .NET 4.5 and highr, Phone 8, Windows Store App (Win 8) and higher. Any ideas?
The documentation on MSDN lists the method as supported in Portable Class Libraries. Also it is supported in .NET 4 & 4.5 and Windows Store Apps from version 8. The only platform I was not able to find an implementation for is Windows Phone 8.
So I suspect that this is the reason why it is not available in your PCL. I verified this in a test project and as soon as you remove the WP8 platform for the PCL, you can call AsParallel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With