windows-services

Installing a self-developed Windows Service

I'm trying to deploy a service that I wrote. Here's the InstallLog file: Installing assembly 'c:\Users\brwatson\Development\Projects\TweetLinks\TweetLinkQueue\bin\Debug\TweetLinkQueue.exe'. Affected parameters are: logtoconsole = assemblypath = c:\Users\brwatson\Development\Projects\TweetLinks\TweetLinkQueue\bin\Debug\TweetLinkQ...

C# - Windows Service installer fails in custom action

We install a windows service from a custom action as described here: CodeProject Every so often, when uninstalling our application, it does not properly uninstall the service. Instead it "marks the service for deletion". You can see this message by running installutil.exe /u on our executable, when it is supposedly uninstalled. Has a...

Fast IO Disallowed and SQLite.

I have a windows service which uses the SQLite database backend. I can run the service fine under my account, however when I run it under the Local System account it runs into issues. I used process monitor and found out it encounters a FAST IO DISALLOWED when attempting to use the database.db-journal file. The actual line is below: 10:...

How do I return a value from a console application to a service in .NET?

I have a .NET service. I have a .NET console application. I want something along the lines of the service calling Process.Start("consoleapp.exe") and getting some information returned back from the app, ideally just returning a number. How do I do this? Edit: I figure it must be: Process.Start("myapp.exe").ExitCode - but how do I se...

Reasons for windows service to stop

I have designed a windows service in C#, which runs continiously and spawns three threads. The first thread runs every 15 sec. The second thread runs every min. And the thirs runs only once. My problem is that this windows service somehow just stops after few days.There is nothing logged in the eventlog on the day of stopping.And it did...

How do I alter a .NET application/user settings on installation?

In a Windows Service project, with a Project Installer I tried the following: [RunInstaller(true)] public partial class ProjectInstaller : Installer { public ProjectInstaller() { InitializeComponent(); } protected override void OnBeforeInstall(System.Collections.IDictionary savedState) { base.OnBefor...

Send command to service from C++

Hello, how can I send command to a Windows service from C++? Equivalent .NET code is: ServiceController sc = new ServiceController("MyService"); sc.ExecuteCommand(255); ...

Cannot capture screen

I have a windows service running on a client machine. I need to capture the screen of the client and sent it to server over the remoting. When I run the exe file, it can capture the screen and send it to the server fine. But when I run it as a service, it logs the following error: "The handle is invalid." The service's "interact with d...

How do you ensure windows applications and windows services access the same ProgramData on Win2008 x64?

I have a windows forms application that reads and updates an XML file with information which a windows service must act on. This has been working on Windows Server 2003, XP and Vista (x32) for some time. Now, when installed on Windows Server 2008 x64, strange things have started happening, thanks I assume to the User "VirtualStore" fol...

How configure log4net for a c# Windows service

I have a windows service where the app.config file and the log4net.config files are seperate. The logging is not working. In my app.config file, I have the following in the section: <add key="log4net.Config" value="log4net.config"/> This works if in the value I specify an absolute path to the log4net.config file. Do I need to suppl...

WIX ServiceInstall - setting the service to run under the NetworkService account

Hi All, This is my first post on StackOverflow so be gentle :) I am trying to create a WIX installer to install my windows service to run under the NetworkService account and getting an Insufficient Priviledges error during the installation. I found this post where someone seems to be experiencing the same problem but no real solution...

Querying a Windows Service status in C# on a Web Application

Hi All, We are using the ServiceController object to query if our Service is running or not. Our web application that is performing the query is using Impersonation for security/login. System.ServiceProcess.ServiceController sc = new System.ServiceProcess.ServiceController("myService"); return sc.Status Using an Administrator account...

Best practice for writing a self-updating windows service

We need to create a windows service that has the ability to self update. Three options spring to mind, a second service that manages the retrieval, uninstallation and installation of the first service. Use of some third party framework (suggestions welcome. I believe .NET supports automatic updating for windows forms apps, but not wi...

how to run a application with fault handling when windows startup

hi, all. i got a wired case i got two console .net applications. let say app1 and app2. i want both the applications run when the windows server startup (without login, my two apps will run automatically) but there is a rules, app1 must run at least 10 minutes before app2. and any one of them crash, i want them can raise up again autom...

How to create windows service from java jar ?

I am having an executable jar file. Is it possible to create windows service of that jar? Actually i just want to run that on startup, but i don't want to place that jar in my startup folder, neither in registry. ...

Linux Mono Equivalent of .NET Windows Service

I have a .NET Windows service that I would like to port to Mono on Linux. What would be the proper way to install the service on Linux so that it works like a Windows service (i.e. autostart, runs when no users are logged in, etc)? ...

Load dll's from Environment Variable Path from a service

We install Matlab Runtime on a machine, then we restart a .net windows service that invokes methods from the Matlab Runtime. The problem is that we receive TypeInitializationException errors until we restart windows. We think this happens because Environment Variables are not changed on services until restart and Matlab uses the %Path% v...

Can I make my service keep Windows from going to sleep?

I have a Windows service that needs to run on a PC that is left on 24 hours. I can't rely on the PC having sleep/shut down disabled because it is something being installed on around 3500 sites and X, Y or Z might mean that sleep/shut down is not disabled. Is there some neat .NET way I can keep Windows from snoozing? Or would periodica...

Find which account a service is set to "Log On As"

How to find out the user account (Local System/User etc) a service is set to run under ("Log On As")? Unlike this similar question this code can't run from within the service itself and the service may not be running. The System.ServiceProcess.ServiceController class has useful methods for getting the status but not the "Log On As" use...

C# Windows service needs to make registry changes

I have a service that needs to update the registry every 5 minutes (counteract gpo). The code runs fine in a regular application, but when I put it in a windows service, it doesn't make the changes. I am using the local system account for the service and it is not throwing any exceptions The code below works in a regular console app b...