473,672 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows Service Recovery Settings

I have written a Windows Service in C# and need to "Restart the Service"
when the service fails.

Is there any way to have these settings happen automatically as part of the
service installation?

Thanks,
Tom
Jun 27 '08 #1
2 7097
See here for somebody's nice work:

http://www.codeproject.com/KB/instal...?display=Print

Peter
"Tom Bean" <tb***@newsgrou p.nospamwrote in message
news:Oq******** ******@TK2MSFTN GP04.phx.gbl...
>I have written a Windows Service in C# and need to "Restart the Service"
when the service fails.

Is there any way to have these settings happen automatically as part of
the service installation?

Thanks,
Tom

Jun 27 '08 #2
Peter,

Thanks for your response. For some reason, it didn't show when I went to
the C# newsgroup to see if anyone had responded even when I hit 'Refresh',
so that's why I didn't respond earlier.

Jeffery Tan from Microsoft sent me a message asking if your reply helped so
I read the article you suggested and it gave me the information I needed.

Thanks,
Tom

"Peter Bromberg [C# MVP]" <pb*******@nosp ammin.yahoo.com wrote in message
news:17******** *************** ***********@mic rosoft.com...
See here for somebody's nice work:

http://www.codeproject.com/KB/instal...?display=Print

Peter
"Tom Bean" <tb***@newsgrou p.nospamwrote in message
news:Oq******** ******@TK2MSFTN GP04.phx.gbl...
>>I have written a Windows Service in C# and need to "Restart the Service"
when the service fails.

Is there any way to have these settings happen automatically as part of
the service installation?

Thanks,
Tom

Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4449
by: Nathan Sokalski | last post by:
I want to set up SQL Server on Windows XP Pro so that I can use the database capabilities of ASP and IIS. I am probably using some incorrect settings, but I am not sure what they are. Here is what I am currently doing: When I run sqlservr.exe I see the following: 2003-12-19 15:51:28.20 server Microsoft SQL Server 2000 - 8.00.760 (Intel X8 6)
1
434
by: Mike Mazar | last post by:
I have a service which I create in vb.net. I'm trying to use the Recovery feature of Windows 2000/XP to restart the service if it fails to start. Looks like there are some steps that a service must perform for this feature to work, like settings the value of WIN32_EXIT_CODE. Does anyone know how to write a service using .net so it can use Recovery feature of Windows? Thanks Mike
4
15884
by: Keith | last post by:
I'm in the same boat as the fellow who posted this message back in August: Title : Windows Service, How does one make a service "fail" properly? Author : Ross Bennett Group : microsoft.public.dotnet.languages.csharp URL :...
2
8934
by: Strahimir Antoljak | last post by:
I am creating a new windows service and I would like to control its Recovery property. On a system administrator level the Recovery property is found in Control Panel -> Administrative Tools -> Services -> Service Properties (right click on a service) -> Recovery tab -> First failure, Second failure properties. Would anyone know if I can (and how) control First, Second Failure property programmatically instead of going to the...
2
1354
by: m00nm0nkey | last post by:
I need to make my service fail so that I can utilise the recovery settings in the service config screen. The recovery settings should let me either restart the service, run a program or restart the computer, however, my VB.Net services have never failed! Is there a way I can programatically make them fail? Thanks.
1
3692
by: Sergey Krutous | last post by:
Can you please help me to resolve the following issue: I developed a windows service. At start up (I have overriden OnStart method) it connects to a web service and if the connection fails the windows service sets ExitCode property to non-zero value (55) and calls Stop method. If this happens when user starts the service in Services snap-in SCM shows error massage and service stops - it's OK. I configured automatic startup and Recovery...
3
5871
by: sokolo | last post by:
Hello, I wrote a windows service application however it is not working. The service is supposed to enter a new task every 5 sec within Microsoft Outlook. Here is the code for application: public partial class CheckAccountsService : ServiceBase {
1
4506
by: svandanapu | last post by:
Hi All, I written one windows service and its working fine. I Need to check the recovery settings of that service from one windows application. How do I can get the recovery settings of(first failure, second failure and third failure) a service programatically. can any one please help me in this regard. Thanks in advance Sivakumar V
0
1170
by: Snofkeen | last post by:
I have created a Windows service that tracks the file system and perform actions according to received input. the service is working, though I need to set it's recovery serttings, meaning, I need to set what will occure during first failure + I need to be able to set the fail counter. Is there a way to control these settings from the .Net framework? Is there a different way to be able to recover the service in case of failure?
0
8500
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8943
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7465
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6254
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5719
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4238
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4437
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2835
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1834
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.