C# 类型或命名空间名称';ThreadPoolTimer';找不到

C# 类型或命名空间名称';ThreadPoolTimer';找不到,c#,C#,我正在尝试使用类ThreadPoolTimer。但我犯了个错误 错误CS0246:无法找到类型或命名空间名称“ThreadPoolTimer” 被发现” 以下是我的代码: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace learning {

我正在尝试使用类
ThreadPoolTimer
。但我犯了个错误

错误CS0246:无法找到类型或命名空间名称“ThreadPoolTimer” 被发现”

以下是我的代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace learning
{
        static void Main(string[] args)
        {
            ......
            ThreadPoolTimer Timer = ThreadPoolTimer.CreateTimer(() =>
            {
                try
                {
                    Console.WriteLine("Ready to delay 5s");
                    await Task.Delay(5000);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.ToString());

                }
            }, delay);
   ......
}

ThreadPoolTimer不适用于控制台应用程序,请改用System.Threading.Timer。ThreadPoolTimer适用于Windows应用商店应用程序或UWP应用程序。谢谢。我以后再试试