Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# System.Windows.Threading不工作_C#_Visual Studio_Visual Studio 2013 - Fatal编程技术网

C# System.Windows.Threading不工作

C# System.Windows.Threading不工作,c#,visual-studio,visual-studio-2013,C#,Visual Studio,Visual Studio 2013,我正在尝试使用System.Windows.Threading使用但它给了我 命名空间“System.Windows”中不存在类型或命名空间名称“Threading” 我有.NET的最新版本。您必须添加对包含要使用的类的程序集的引用 此外,如果没有使用WPF应用程序向导创建项目,则可能不希望使用WPF类(来自System.Windows.Threading) 编辑:在Windows窗体应用程序中,定时器的明显选择是,在某些情况下。它是使用System.Threading不使用System.Win

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

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


我有.NET的最新版本。

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

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


编辑:在Windows窗体应用程序中,定时器的明显选择是,在某些情况下。

它是使用System.Threading
使用System.Windows.Threading
。不知道您是否在代码中使用了该选项,只是在这个问题上犯了一个错误,但它确实存在。

请确保您已在项目中添加了对WindowsBase.dll的引用,然后您就可以开始了。看看-


如果您仍然有问题,请附加.csproj文件。

它位于WindowsBase.dll中,添加引用后,它就可以工作了

(如果不知道如何添加引用,请参见。)


是否有一个局部变量作为
线程处理
?为什么要使用该名称空间?它是WPF应用程序吗?该名称空间的类型驻留在
WindowBase.dll
中,它应该是WPF应用程序的参考。根据应用程序的类型,可能会使用不同的名称空间或添加对该程序集的引用。不,我创建了一个新的
C#
类,它在第一行给出了错误。我想将其用于
Dispatchermer
抱歉,但我不熟悉此功能。我想在我的应用程序中实现倒计时,因此想使用
Dispatchermer
,但它不工作