473,698 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows service timeout

Hello everybody. I'm currently developing a windows service. In OnStart
a launch two threads that carry on some work while the service is
running. My problem comes from the fact that once the service is
installed, it just time out at system startup and don't start. But i'm
able to start it manually once i'm logged in. I read in a page
something about signed assemblyes, saying that clr have to verify the
executable at startup, causing the delay. I just unsigned the assembly
and still face the same problem. I also notice that some compilation of
the solution start at system starup, and othes does not, with out
aparent reason, because there is no code change. Any sugestion? Thanks
in advance.

Jul 10 '06 #1
2 8716
Cubaman,
You don't show any sample code for what is happening in the OnStart method.
OnStart basically gives you a 30 second SCM Timeout.
So if you are kicking off 2 threads, they should be background threads and
the Start methods must return within the startup timeout period.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Cubaman" wrote:
Hello everybody. I'm currently developing a windows service. In OnStart
a launch two threads that carry on some work while the service is
running. My problem comes from the fact that once the service is
installed, it just time out at system startup and don't start. But i'm
able to start it manually once i'm logged in. I read in a page
something about signed assemblyes, saying that clr have to verify the
executable at startup, causing the delay. I just unsigned the assembly
and still face the same problem. I also notice that some compilation of
the solution start at system starup, and othes does not, with out
aparent reason, because there is no code change. Any sugestion? Thanks
in advance.

Jul 10 '06 #2
Hello Peter, and thanks for your answer. Here is the code i'm executing
in OnStart method:

/// <summary>
/// Method launched on service start.
/// </summary>
/// <param name="args">non e</param>
protected override void OnStart(string[] args) {
ThreadPool.Queu eUserWorkItem(n ew WaitCallback(Jo bWs),
null);
ThreadPool.Queu eUserWorkItem(n ew
WaitCallback(Jo bManteinance), null);
//// Write info to eventlog, so controler detects the
service start.
eventLog.WriteE ntry("Service started",
EventLogEntryTy pe.Information) ;
}

JobWs and JobManteinance are two functions that do all the work.
What do you mean by background thread? A thread with a low priority?
Thank you, best regards.

Oscar Acosta
Peter wrote:
Cubaman,
You don't show any sample code for what is happening in the OnStart method.
OnStart basically gives you a 30 second SCM Timeout.
So if you are kicking off 2 threads, they should be background threads and
the Start methods must return within the startup timeout period.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Cubaman" wrote:
Hello everybody. I'm currently developing a windows service. In OnStart
a launch two threads that carry on some work while the service is
running. My problem comes from the fact that once the service is
installed, it just time out at system startup and don't start. But i'm
able to start it manually once i'm logged in. I read in a page
something about signed assemblyes, saying that clr have to verify the
executable at startup, causing the delay. I just unsigned the assembly
and still face the same problem. I also notice that some compilation of
the solution start at system starup, and othes does not, with out
aparent reason, because there is no code change. Any sugestion? Thanks
in advance.
Jul 18 '06 #3

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

Similar topics

2
8461
by: hnkien | last post by:
Hi, I am writing a windows service with threading.timer for 10 seconds but it didn't work. Here are my code: namespace SchedulerService { public class ScheduleService : System.ServiceProcess.ServiceBase { private System.ComponentModel.IContainer components; protected System.Threading.Timer tmrThreadingTimer;
5
14120
by: Richard Steele | last post by:
I have created a WinForm application that needs to be run as a windows service (the PC is inaccesible by any user) i have successfully installed the application as a windows service. When i start the service, i get the following error Error 1053: The service did not respond to the start or control request in a timely fashion 1. Is there anyway to extend the timeout period.? I use timed threads to load a serial device driver and this...
2
6121
by: Genojoe | last post by:
I have a Windows Service (VB.NET) that runs 24/7. It contacts a Web Service (VB.NET on IIS). As long as we send requests to the Web Service at least once every 15 minutes, everything works fine. We send the request asynchronously and wait for the response. When there is a 30 minute or greater gap between requests, we get the following error message in the Windows service return thread: Error #: 5, Description: The underlying...
0
1660
by: Seth | last post by:
For some reason my service works fine except that it will create the file in my c drive, but will not write to the file. Sorry if this is a duplicate post, i have found some that ask the same question - but noone seems to answer. Do i need to do anything specific to write to a text file from a windows service, much appreciated.
6
8107
by: D | last post by:
I have a simple file server utility that I wish to configure as a Windows service - using the examples of the Python Win32 book, I configured a class for the service, along with the main class functions __init__, SvcStop, and SvcDoRun (which contains my server code). After registering the service, I am able to start it with no problems. However, it never stops correctly (net stop returns "service could not be stopped") and service is left...
6
5183
by: archana | last post by:
Hi all, I am executing one stored procedure in windows service. I set sqlcommad's CommandTimeout to 432000 which means 5 days timeout. Still after 11th hour i am getting timeout. I am not getting if i set timeout as 5 days why i am getting timeout before that. Please shed some light on it.
0
8274
by: =?Utf-8?B?QWRyaWFuIENvbGU=?= | last post by:
I have written a simple WCF service hosted in a Windows console application and a simple WCF client console application that connects successfully to that service and retrieves data. I then ported the console application to WinForms and also got that to work properly. My next move was to host the WCF service in a Windows service application. I believe I have that working correctly, but I can't for the life of me get a client to connect...
28
7366
by: | last post by:
I have a multi threaded windows form application that runs great after calling Application.Run(). Application.Run is required for a COM component I a using in the app (required for message loop). I have created a windows service from VStudio 2005 template. What is the windows service replacement for Application.Run()?
4
9692
by: =?Utf-8?B?am1hZ2FyYW0=?= | last post by:
I've written a .net Windows service in C#. It works most of the time for most people. It is configured to automatically start when Windows boots. Sometimes it fails to start on Windows XP during boot. All I know is that it is timing out. But no useful details appear in the event log, not even my first EventLog message in OnStart. How can I figure out why it isn't starting? How can I fix this? My ServiceBase constructor just sets a few...
0
8676
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
8608
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9161
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
9029
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5860
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
4370
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...
1
3050
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
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.