473,387 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Controlled Failure Of a Windows Service

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.

--
welcome to the mooon !
Feb 15 '06 #1
2 1336
m00nm0nkey wrote:
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.


Run the Stop() method.
Feb 15 '06 #2
What, like this?

Private Sub tmrScheduler_Elapsed(ByVal sender As System.Object, ByVal e As
System.Timers.ElapsedEventArgs) Handles tmrScheduler.Elapsed

If gblnSomethingBadIsHappening Then

OnStop()

Else

tmrScheduler.Stop()
tmrScheduler.Enabled = False

SchedulerTimerRespond()

tmrScheduler.Enabled = True
tmrScheduler.Start()

End If

End Sub

??
--
welcome to the mooon !
"John Bailo" wrote:
m00nm0nkey wrote:
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.


Run the Stop() method.

Feb 15 '06 #3

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

Similar topics

10
by: x2164 | last post by:
hi all, Linux 2.4.28 Glibc 2.2.5 gcc 2.95.3 I'm new to Python. I've compiled Python 2.4 from tar file.
1
by: Mack | last post by:
I have written a Windows Service, and while it was working fine previously, it will not start now! Everytime I try to start it, I get a message which reads: "..service was started and then...
1
by: amirmira | last post by:
I have developed a service that monitors the CPU utilization performance counter and updates a table in a database. During the Service Start up, I attempt to connect to the database. I would like...
2
by: robboll | last post by:
On a Windows 2000 Server in MYDomain I can do the following successfully: Net Send JoeUser "test" However on a Windows Server 2003 (Standard Edition) in MyDomain I get: An error occurred...
0
by: HJ | last post by:
The Windows platform provides a mechanism to automatically restart a service when a failure occurs in the 'Recovery' tab in the services panel. It allows you to specify actions on first, second...
1
by: techfuzz | last post by:
I'm posting my problem experience and solution I found here for other ASP.NET developers. I have a web application that uses Forms Authentication with Active Directory to control access. In...
14
by: Bernie Yaeger | last post by:
OK - I'm very close. I'm running a console app on a server and it fails with cdo .message failure. It's a simple email routine which works fine on my development pc. Do you have any idea what...
0
by: Hernan Garber | last post by:
Hi, Attached, the installation log. Win 2k Server SP3 IE6SP1/SQL Server Installed Thanks Setup.exe: Setup.exe: ========== Logging started ==========
0
by: jkehayias | last post by:
I have a windows service I created that works perfectly in debug, but as soon as I put it out and install it as a service from release, it gets 2 ticks through the timer and then nothing. Here is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.