Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error CS0012: The type 'TaskAwaiter<>' is defined in an assembly that is not referenced

When I try to debug my Windows Phone 8.1 project the Locals window is empty, and Watch shows an error for this:

this    error CS0012: The type 'TaskAwaiter<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.  

Everything else seems to work just fine, there are no errors/warnings related to this, it happens only while debuging. And also not for all projects.

I've tried a few fixes I found on Stack and MDSN, but:

  • Adding <CheckForSystemRuntimeDependency>true</CheckForSystemRuntimeDependency> didn't change anything;
  • Debug > Options > General > Use legacy VB and C# something is greyed out.

Is there anything else I can try?

like image 678
Reynevan Avatar asked Aug 17 '15 14:08

Reynevan


1 Answers

This is a known issue in Visual Studio 2015.

Workaround: enable the legacy C# and VB expression evaluators. (You got that right.)

Tools > Options > Debugging > General > Use the legacy C# and VB expression evaluators

Important: You cannot check the box during debugging!

like image 56
seb Avatar answered Oct 08 '22 01:10

seb