简体   繁体   中英

Windows Service needs to restart to keep its functioning

I have created a windows service that sends email reminders every 30 seconds. 10 days before it was working fine but now it doesn't run until it is restarted manually from services.msc

Once it is restarted, the service then sends email.

The window service is written in C# and in Visual Studio 2005.

Let me know if any info needed.

Thanks for your inputs!

UPDATED:Event viewer error descripition

Timestamp: 4/5/2011 6:03:53 AM
Message: There is no explicit mapping for the categories 'Application'.
The log entry was:
Timestamp: 4/5/2011 6:03:53 AM
Message: Error Type: ERR_RETRIEVING_DATA
Entity Information: Get
Session Info: Object reference not set to an instance of an object.

Category: Application
Priority: -1
EventId: 0
Severity: Information
Title:
Machine: VPS
App Domain: EinsteinEMRServerSetupSupport.exe
ProcessId: 3660
Process Name: C:\\SOAPe Platinum Plus\\EinsteinEMRServerSetupSupport.exe
Thread Name:
Win32 ThreadId:3680
Extended Properties:
Category:
Priority: -1
EventId: 6352
Severity: Error
Title:
Machine: VPS
Application Domain: EinsteinEMRServerSetupSupport.exe
Process Id: 3660
Process Name: C:\\SOAPe Platinum Plus\\EinsteinEMRServerSetupSupport.exe
Win32 Thread Id: 3680
Thread Name:
Extended Properties:

对于Windows服务的问题,很多时候,查看Windows事件的日志可以定位到功能异常,但是正如Jon Skeet所说:很难为您提供更精确的定位而没有细节。

Ok, ERR_RETRIEVING_DATA seems a bit tricky. Sounds like a I/O problems on hard drive (due to termination), but strange to see it works after a restart. It could be anything in the system.

What is the information you're trying to get ?
How do you try to get it ?

Does your problem appears after a reboot of the machine ?
Wouldn't it be because of your service's list start order ?

If "Your" service start before the resources that it needs, you would be unable to reach it (For example, starting before MSMQ while trying to push/get messages).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM