System.Windows.Threading 不工作

0 c# visual-studio visual-studio-2013

我正在尝试使用,using System.Windows.Threading;但它给了我

命名空间“System.Windows”中不存在类型或命名空间名称“Threading”。

我有最新版本的 .NET。

yu *_*ian 6

它在WindowsBase.dll 中,添加引用后,它起作用了!

(如果您不知道如何添加引用,请参阅本教程。)

在此处输入图片说明


Tim*_*mbo 1

您必须添加对包含要使用的类的程序集的引用。

此外,如果您没有使用 WPF 应用程序向导创建项目,您可能不想使用 WPF 类(来自 System.Windows.Threading)。

编辑:在 Windows 窗体应用程序中,计时器的明显选择是System.Windows.Forms.Timer,在某些情况下是System.Threading.Timer。