×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

.NET namespace "System.Timer" not found

Hi every .NET guy and girl,

I'm trying to add a reference to "System.Timers" to my .NET app project, but it coun't be found in the .NET component list in the "Add Reference" dialog box. Neither can it be found in the .NET framework direction (%systemroot%\Microsoft.NET\Framework\v1.0.3705).

Could you please check if the file "System.Timers.dll" exists in your Visual Studio.NET installation machine? --- Actually none of the System.T* assemblies (System.Text.*, System.Threading, System.Timers) appear on my machine.

Many thanks,
fenix
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / .NET namespace "System.Timer" not found
    Hi every .NET guy and girl,

    I'm trying to add a reference to "System.Timers" to my .NET app project, but it coun't be found in the .NET component list in the "Add Reference" dialog box. Neither can it be found in the .NET framework direction (%systemroot%\Microsoft.NET\Framework\v1.0.3705).

    Could you please check if the file "System.Timers.dll" exists in your Visual Studio.NET installation machine? --- Actually none of the System.T* assemblies (System.Text.*, System.Threading, System.Timers) appear on my machine.

    Many thanks,
    fenix
    • 我猜你应该用 using System.Threading; 而不是 using System.Timer;
      • Thanks for your quick response! But I'm really need to reference to System.Timers (sorry for my previous misspelling).
        I'm working on a "Windows Service" component, in which a timer (System.Timers.Timer) must be instanciated to poll some data from the system constantly. The service is so simple that only one thread is enough. So no need to manipulate the default threading environment. Even I should use System.Threading, I couldn't reference to it --- no file has such naming pattern as "System.T*.dll" in my machine.

        By the way, could you find the file in your machine?
        Thanks,
        fenix
        • Timer class 包含在 System.Threading namespace 中。 Mscorlib.dll 是需要的 dll. 但一般不用制定,因为它是 .NET 的最基本组件之一。
          • According to MSDN, "System.Timers.Timer" is another class different from "System.Threading.Timer". I think in my case I should use the prior one. Shouldn't I? Thx,
            • 看来我误解了。 我查了一下,System.Timers.Timer 应该引用 System.dll.
              • You're right! I found it in "System.dll". Salute :)
    • Mscorlib.dll 包含 System.Threading namespace. Mscorlib.dll 是 .NET 的基本组件之一。