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

社会主义新天地 提交于 2019-12-12 07:52:10

问题


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?


回答1:


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!



来源:https://stackoverflow.com/questions/32053129/error-cs0012-the-type-taskawaiter-is-defined-in-an-assembly-that-is-not-ref

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!