473,471 Members | 2,040 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem with windows service OnStop event

271 Contributor
Hi,
I have created a windows service and i have written code in OnStart and OnStop event. when i manually start and stop the service it works fine. But when i restart the machine the OnStop event is not working but the OnStart event is working fine. This service depends on network connection for storing data to a remote DB. I have attached the 'netman(network connection)' in the service dependency. There is no error message in the event viewer also.
If this is not the correct location to post this question please re-direct this question to the corresponding section.

Thanks & Regards
karthi
Aug 5 '08 #1
3 2376
r035198x
13,262 MVP
You put code in the OnShutDown method of you want it to be executed when the computer is shut down while the service is running.
Aug 5 '08 #2
karthi84
271 Contributor
You put code in the OnShutDown method of you want it to be executed when the computer is shut down while the service is running.
when i tried with OnShutDown i get the following error

Error 1 'Test.OnShutDown()': no suitable method found to override F:\Dot Net Works\Projects\Test\Service1.cs 72 33 Test



I am new to services. Please explain me in solving this problem
Aug 5 '08 #3
karthi84
271 Contributor
You put code in the OnShutDown method of you want it to be executed when the computer is shut down while the service is running.
thanks r035198x ,
I have got this issue fixed.
Aug 5 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Daniel O'Brien | last post by:
Hi - any help with this would be greatly appreicated - it has already had me confused for a good few hours! I am using Visual Studio 2003 and the .NET framework 1.1. I have a C# Windows...
4
by: Groundskeeper | last post by:
I can't seem to get a custom UnhandledException handler working for a Windows Service I'm writing in VB.NET. I've read the MSDN and tried various different placements of the AddHandler call, to no...
0
by: Daniel O'Brien | last post by:
Hi - any help with this would be greatly appreicated - it has already had me confused for a good few hours! I am using Visual Studio 2003 and the .NET framework 1.1. I have a C# Windows...
0
by: edurazee | last post by:
I am able to create BoundFields and Footer-rows dynamically like this in my GridView: protected void Page_Load(object sender, EventArgs e) { CreateGridView(); ...
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
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
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...
0
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...
0
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...

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.