windows-services

Performance logging tips

I am developing large data collecting ASP.Net/Windows service application-pair that uses Microsoft SQL Server 2005 through LINQ2Sql. Performance is always the issue. Currently the application is divided into multiple larger processing parts, each logging the duration of their work. This is not detailed and does not help us with anything...

Silverlight 3 and System.ServiceProcess - Doesn't allow the reference to be added.

I'm trying to write a program that can stop and start services using SilverLight 3 and VS2010. I can't add the reference to the System.ServiceProcess dll. C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.ServiceProcess.dll 1st why? - It it just a security precaution? 2- Is there a work around? Does SilverLight have a different lib...

How do you program a windows service in C# to start an application for a user?

Is it possible to start a program so that it is available to a user with a windows service? I have been working with the Process.Start() in C#. I can get the service to kickoff some sort of process that appears in the Task Manager list under processes. However, the program nevers appears on the screen. By default, it runs under the u...

How to automatically start a C# WebService?

Hi, I have written a C# WebService. The problem is that after I publish it to IIS it won't automatically start unless any of its methods is called. This is very frustrating because this WebService has to continuously do some background work immediately after it starts (its constructor executes). If IIS is restarted, the WebService will ...

Windows Service WebBrowser DocumentCompleted Bug

I've been building a Windows Service to create a WebBrowser object to navigate, login, and download a site's HTML. However, I recently discovered this bug which prevents the DocumentCompleted event from firing if the WebBrowser is not visible: http://support.microsoft.com/kb/259935 I've got to assume this is because the Windows Service...

Postgres command line install from zip file fails to properly start the windows service after the database has been configured

Below is the batch file I am kicking off at the end of an installer to properly configure my postgres database, however there comes an issue wherein the service is unable to be started. This is what the service parameters look like: C:\Program Files\pgsql\bin/pg_ctl.exe runservice -N "MyPostGres" -D "C:/Program Files/pgsql/PGDATA" ...

Will Windows wait for my service on startup?

I've written a service that is to be started automatically. It does some initialization stuff in its OnStart method, including setting up SENS watchers for who logs in. Will Windows wait until my OnStart method is complete before it allows uers to log in, or is it possible that such a login could happen before my watchers are set up, if...

Java Windows Service with Procrun, StopMethod problem

My Java class contains the following methods: public static void main(String[] argv) //start the service public static void stop() //stop the service I'm using Procrun from Apache Commons Daemon to setup the Java class as a Windows Service. I get an error when I try to stop the service "[618 javajni.c] [error] Static method 'void ...

What is a Windows Service and how does its lifecycle differ from a "standard" EXE?

I found the following answer to that question: A service opens before you even get to the login screen, whereas a standard exe cannot open until after you have logged on. Just i want to verify the answer is correct or not. ...

Windows Services in Win7?

I am trying to make a service that spawns a desktop application, and then watches to make sure it restarts again if it is closed. . I would like it to basically spawn the process and then forget about it, allowing to act like a normal interactive application. (Apparently this is much easier to do in XP and before, but I need this for XP...

Running Services.msc as a different User C#

Hi, I have a requirement to create a simple windows forms application that allows an admin user to manage the Services on remote servers. We don't want to give the admins the usernames and passwords to the servers so these will be encrypted and stored in a database. My question is whether or not it is possible to spawn a Services.msc wi...

C# Getting a string from one config file to be used by multiple projects

Hi everybody. In my project I have a Windows Service and a WCF Service doing some actions on the same folder on a computer. The location of that folder will be given by the user within an app.config file that is included in the Windows Service project. Now, I want the WCF Service to know the location of that folder (the folder given by...

Windows Services dependencies on shutdown?

Hello everyone I have a Windows Server 2003 and I have a windows service A which depends on a second service B. Service A is created by me, and service B is SQL Server 2008, so my service needs to save data into the database using SQL Server when Windows is shutting down. The problem is that sometimes, SQL Server is killed before my ser...

Windows Service on NetworkService account can't access remote (shared) directory

I'm trying to remotely access a shared folder with a Windows Service set to NetworkService account permissions. However, I get errors when I try to do this, e.g. Directory.Exists(servicePath) returns false, FileSystemWatcher doesn't recognize activity in the directory. If I change the service's account to LocalSystem, these methods wor...

Class library assemblies used by Windows Services written in C#

If I write a C# class called Foo and that is compiled into an assembly named FooLib.dll. Then, I write a Windows Service in C# that references FooLib.dll. When I deploy my Windows Service using InstallUtil.exe: a) do I have to explicitly tell it to reference my FooLib.dll? b) where does FooLib.dll get deployed if I mean to deploy it as...

Scheduled task with windows services and system.timer.timer

Hi i want implement a windows services scheduled task. I already created windows service. In a service i have implemented a timer.The timer is initialized at class interval. The timers interval is set in the start method of service and also it is enabled in the start method of the service. After timers elapsed event is fire i have done s...

Windows Service Conundrum

All, I have a Custom object which I have written using VB.NET (.net 2.0). The object instantiates its own threading.timer object and carries out a number of background process including periodic interrogation of an oracle database and delivery of emails via smtp according to data detected in the database. The following is the code im...

How do I stop Mercurial's "hg serve -d" service under Windows?

I'm technically savvy but don't have extensive experience with servers/daemons (I'm a Windows guy, so...command lines intimidate me). I started a Mercurial server using the hg serve -d command, and all was well. Now, I want to stop it, and can't find a process to kill. Does anybody know the process name or a relatively simply CLI ...

Where can I find a good description on how to use COM with Windows Services?

Hi there, I'm looking to pass parameters into a Windows Service not only upon launch but while it's still running as well. I've heard the best way to do this would be through the COM but I have no idea where to even get started. Are there any good places you can recommend where I can find some helpful information about how to get started...

DIfferentiate Between Windows Service Startup as part of System reboot and Service stop/start using sc tool

Hi, How do I differentiate in my C++ code between a service coming up as a part of system reboot and service coming up since the user stopped and started the service manually in service manager or using sc tool???? ...