Asad ullah
Asad ullah

Reputation: 88

The "Csc" task failed unexpectedly Could not load type System.ValueTuple 3 from assembly mscorlib Version=4.0.0.0,

While building the project in MS Visual studio 2017, it comes up with above error, i tried with restore NuGet packages, and the visuals studio shows this error, please help to resolve it

"The "Csc" task failed unexpectedly.
System.TypeLoadException: Could not load type 'System.ValueTuple`3' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
   at Microsoft.CodeAnalysis.BuildTasks.ManagedToolTask.GenerateCommandLineCommands()
   at Microsoft.Build.Utilities.ToolTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() AppModelv2-WebApp-OpenIDConnect-DotNet          
"

Upvotes: 4

Views: 1921

Answers (1)

So_oP
So_oP

Reputation: 1293

For .NET 4.6.2 or lower

you need to install the NuGet package System.ValueTuple.

Install-Package "System.ValueTuple"

If this does not work please make the follow steps.

1.Locate you project’s packages folder

2.Delete the folder

3.Rebuild your project

Upvotes: 2

Related Questions