惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Check Point Blog
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
IT之家
IT之家
月光博客
月光博客
U
Unit 42
K
Kaspersky official blog
T
Threatpost
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
GbyAI
GbyAI
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
云风的 BLOG
云风的 BLOG
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
Engineering at Meta
Engineering at Meta
Recorded Future
Recorded Future
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Security @ Cisco Blogs
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
Security Archives - TechRepublic
Security Archives - TechRepublic
Webroot Blog
Webroot Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
Schneier on Security
S
Secure Thoughts
The Register - Security
The Register - Security
B
Blog RSS Feed
The Last Watchdog
The Last Watchdog
P
Palo Alto Networks Blog
爱范儿
爱范儿
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
L
LINUX DO - 热门话题
C
Cisco Blogs
Spread Privacy
Spread Privacy
F
Full Disclosure
博客园 - 聂微东
T
The Blog of Author Tim Ferriss

博客园 - guanfei

如何用Nero刻录ape(带cue)cd镜像?详细点,下载啥,装到哪里 Managing assembly version numbers using Visual Studio .NET and Visual SourceSafe RMA是什么 Page.RegisterClientScriptBlock和Page.RegisterStartupScript有何区别 - guanfei - 博客园 button style - guanfei - 博客园 SQL-SERVER取得中文拼音的函数 DesignMode :: Windows Forms designer and DesignMode property issues 项目管理相关 C#区分中英文统计字符串的长度 什么是毅力? The 30 Minute Regex Tutorial Exception 的性能的影响不大。 调试WebService的一个很好的工具 漫谈C#编程中的多态与new关键字 Object synchronization method was called from an unsynchronized block of code. 关于C#中timer类 全文搜索参考 sql 2000 2005 创建全文索引, 中文的需要中文版的sql sql server 2000 全文索引全解(配合ASP.NET)
BUG: The Elapsed event of the System.Timers.Timer class is not raised in a Windows service
guanfei · 2007-08-02 · via 博客园 - guanfei

转:http://support.microsoft.com/?scid=kb%3Ben-us%3B842793&x=13&y=8

SYMPTOMS

You can use the Microsoft .NET Framework to create a new Microsoft Windows service that contains a System.Timers.Timer object. When you run this new Windows service, the Elapsed event of the System.Timers.Timer class may not be raised.

Back to the top

CAUSE

Note In this section, the System.Timers.Timer object is referred to as the Timer object.

In the event handler for the Elapsed event of the Timer object, if you call the Stop method of the Timer object, the reference to the Timer object is lost. The garbage collector then reclaims the memory that is associated with the Timer object. Later, even if you call the Start method of the Timer object to raise the Elapsed event, the call does not work. The Elapsed event is not raised.

Back to the top

WORKAROUND

To work around this problem, obtain the hotfix in the following Microsoft Knowledge Base article:

900822 (http://support.microsoft.com/kb/900822/) FIX: When a .NET Framework based application uses the System.Threading.Timer class, the timer event may not be signaled in the .NET Framework 1.1 S900822

Additionally, use a System.Threading.Timer object instead of the System.Timers.Timer object.