【发布时间】:2013-04-01 04:51:28
【问题描述】:
我正在尝试使用调度计时器,但我的 c# 应用程序找不到命名空间。这是错误:
找不到类型或命名空间名称“DispatcherTimer”(您是否缺少 using 指令或程序集引用?)
这是我正在使用的:
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Globalization;
using System.Text;
using System.Threading;
using System.Timers;
using System.Windows.Forms;
代码如下:
DispatcherTimer timer1 = new DispatcherTimer();
【问题讨论】:
-
您是否在项目引用中为此命名空间添加了引用?根据this
DispatcherTimer生活在System.Windows.Threading命名空间中。 -
我没有添加的选项,system.windows 之后的选择只有表单和xps
标签: c# reference namespaces .net-assembly dispatchertimer