简体   繁体   English

错误CS0012:类型'TaskAwaiter <>'在未引用的程序集中定义

[英]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 : 当我尝试调试我的Windows Phone 8.1的项目本地窗口是空的,并观看显示错误了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: 我尝试过在Stack和MDSN上找到的一些修复,但是:

  • Adding <CheckForSystemRuntimeDependency>true</CheckForSystemRuntimeDependency> didn't change anything; 添加<CheckForSystemRuntimeDependency>true</CheckForSystemRuntimeDependency>没有改变任何东西;
  • Debug > Options > General > Use legacy VB and C# something is greyed out. 调试>选项>常规>使用旧版VB和C#的东西是灰色的。

Is there anything else I can try? 还有什么我可以尝试的吗?

This is a known issue in Visual Studio 2015. 这是Visual Studio 2015中的已知问题。

Workaround: enable the legacy C# and VB expression evaluators. 解决方法:启用旧版C#和VB表达式计算器。 (You got that right.) (你说对了。)

Tools > Options > Debugging > General > Use the legacy C# and VB expression evaluators 工具>选项>调试>常规>使用旧版C#和VB表达式计算器

Important: You cannot check the box during debugging! 重要提示:在调试期间无法选中此框!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误CS0012:类型“DbConnection”在未引用的程序集中定义 - Error CS0012: The type 'DbConnection' is defined in an assembly that is not referenced CS0012 C#类型“ HttpContext”在未引用的程序集中定义 - CS0012 C# The type 'HttpContext' is defined in an assembly that is not referenced CS0012 类型“EventLogEntryType”在未引用的程序集中定义 - CS0012 The type 'EventLogEntryType' is defined in an assembly that is not referenced 使用RazorTemplates库时发生错误:&#39;CS0012:类型&#39;System.Attribute&#39;在未引用的程序集中定义&#39; - Error when using RazorTemplates library: 'CS0012: The type 'System.Attribute' is defined in an assembly that is not referenced' 错误CS0012:类型&#39;ConnectionStringSettings&#39;在升级到Visual Studio 2015后未引用的程序集中定义 - error CS0012: The type 'ConnectionStringSettings' is defined in an assembly that is not referenced after upgrading to Visual Studio 2015 .Net Core-CS0012&#39;对象&#39;在未引用的程序集中定义 - .Net Core - CS0012 'Object' is defined in an assembly that is not referenced CS0012 System.enum在未针对.NET 4.5的构建服务器上引用的程序集中定义 - CS0012 System.enum is defined in an assembly not referenced on build server targeting .NET 4.5 MSBuild错误CS0012 - MSBuild Error CS0012 FluentAssertions 错误 CS0012:您必须添加对程序集 System.Data 的引用 - FluentAssertions error CS0012: You must add a reference to assembly System.Data 带有显式调用的 C# 构造函数歧义 - 错误 CS0012 - C# Constructors Ambiguity with explicit call - Error CS0012
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM