Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is System.Threading.Tasks.Parallel in .NET Standard 1.6?

Tags:

c#

.net

Where is Parrallel in asp.net core 1?

Parallel.ForEach(results, (x) =>
    {
        foo();
    });

The name 'Parallel' does not exist in the current context .NETStandard,Version=v1.6

like image 724
Marcelo Oliveto Avatar asked Aug 31 '16 14:08

Marcelo Oliveto


Video Answer


1 Answers

You'll need a reference to System.Threading.Tasks.Parallel

You can use nuget to get this.
Alternatively, add the following to your project.json

  "dependencies": {
    //
    "System.Threading.Tasks.Parallel": "4.0.1"
  },

Note: This is now out of date, since there's no more project.json

As per comment, add this to your csproj:

<PackageReference Include="System.Threading.Tasks.Parallel" Version="4.3.0" />
like image 153
Alex Avatar answered Sep 28 '22 02:09

Alex