windows-services

WiX uninstaller: restart service if present

Part of our app involves registering a plug-in to a third-party product. While the third-party service is running, it has our DLL loaded, so the files on disk are locked. So when we uninstall our product, we need to begin by stopping the third-party service, and then restart it when we're done with the uninstall. (We also do the same st...

effect on dlls when moving to 64 bit machine

We've had a 32 bit terminal services computer running some Windows services we constructed using .NET. Recently we moved everything to a 64 bit machine. Most things work. However, we are getting grief from a dll for apachefop.net. In particular we get the following error Error: Plugin Transcript Service Execution Failed: Could...

windows service with 32 bit and 64 bit dlls

We have a windows service that uses dlls produced from a bunch of different .NET projects. One of those projects has a dependency on a dll that was compiled on 32 bit machine. We have just moved the windows service to a 64 bit machine. By default .NET projects try to run as 64 bit assembly (because they are being run on a 64 bit mac...

Running windows service as a standalone application during DEBUG mode

I've a windows service that I need to install (installutil) every time I debug the application during development. Is there any way I can tweak the Installer/ProjectInstaller classes so that it runs as a console application during debug mode. Something like #if..#endif preprocessors can help? ...

How to install MySQL as a service with options.

I want to install the MySql service with the --old-passwords flag Iv tried running this and various permutations of it, but cant get it to work. "c:\Program Files\MySQL\MySQL Server 4.1\bin\mysqld-nt" --install MySQL -defaults-File="pathtofile" --old-passwords ...

service contingency for consumer data queue

the operation should be: - one queue, many consumers are ready, but only one active at time; - if a consumer fails the other should be elected; - each consumer in a different host; - must be sure that only one consumer will act at a time; What is the best strategy to ensure the uniqueness in the operation and also the contingency of ope...

Windows service and changing timezone

I have a windows service written in C# with .Net 3.5. It had been running on a server for a few weeks when it was discovered the that the server's timezone was not set correctly. This was corrected but the service was not restarted. To my surprise the service did not pick up the clock change. My question is will this also be a proble...

How to check a service account is built-in network service account?

I need to check if service account in the form of (xxx\yyy$) is an built-in network service account. One way I'm thinking is compare account name with "domainName\hostname$", it's networkservice account if equals; otherwise not. I believe there's some simple API (C/C++) can help me. Anybody know it? ...

Restart Windows Service From Service

Is there any way to restart a windows service from the same service , as Application.Restart() in Windows forms, I don't want to launch another process from the service to restart the service. ...

Can't uninstall a service developed in Visual Studio

I have a Visual Studio project consisting of a service and an installer for it. During the development I have installed and uninstalled the msi-package at least fifty times but last time I tried to uninstall it I got an error message saying "the installed product does not match the installation source" and if I click "Ok" on that message...

Startup Code for Loading COM Object for WCF Service

I am currently have a WCF service that uses a COM DLL for its service. The COM object is only loaded once and saved via a singleton. The problem is the first run takes about 1 minute to load the COM Object. The WCF service is hosted via a Windows Service. I am wondering how can I load the COM Object singleton via the startup of the Windo...

How do you get the current failure count for a windows service

I have a service which will fail when certain resources are unavailable. I have configured it to try restarting twice, then send me an SMS on the third attempt. Unfortunately windows only gives you the option to reset the failure count after a certain number of days, whereas I really want it to reset on every third failure. The problem i...

Hot deployment of .net assemblies

We have an application running as a Windows service on a production server. The application is partitioned into several assemblies mostly on deployment boundaries. I would like to streamline the deployment of hot-fixes to application assemblies. Currently I do the following steps to deploy a hot fix. (we have a duplicate of the productio...

Script to list non-Microsoft Services

Hi guys Been lookin' for a way to list the non-Microsoft Services to a *.txt file. Either using vbs or a batch file will be sufficient. I've tried numerous ways with WMI and the sc.exe command, but can't seem to put my finger on it. Thanks, Tim ...

Windows Service Starts then Stops

I have a Windows Service that I inherited from a departed developer. The Windows Service is running just fine in the QA environment. When I install the service and run it locally, I receive this error: Service cannot be started. System.InvalidOperationException: The requested Performance Counter is not a custom counter, it has to be ini...

Win7 ServiceProcessInstaller Set user login dialog not populating user

We used to prepopulate the user name in our Windows service installers, but under Win7/Windows 2008 MS has changed the behavior. Our simple line of code in the installer this.serviceProcessInstaller1.Username = Functions.GetRegistryPath("", "ServiceUserName"); no longer works and the dialog comes up without the user name prepopulate...

Calling a public method on windows service

I have a timer in a windows service (.NET C#). I need to be able to change the elapsed value from an external program. If the timer is currently running, I need to be able to shorten the time elapsed value from an external program. I was thinking of having a public method in the service that would change the timer elapsed value and r...

copy files from network via windows service

I have batch files, its copy some files from network to local disk. When try to run it from a windows service I get an error like "Access Denied". I already try run windows service as LocalSystem , LocalService and NetworkService. All these types get same error. Have any idea ? Thanks ...

Best way for a .Net Windows service to report an error to the user

I am writing a windows service that will be doing a lot of network communication, and I need a way to notify a user (if logged on) of any exceptions/errors. I know it is bad practice to allow a service to interact with the desktop, so is there an alternative way to notify a user that an error has occurred? I am aware of event logging, bu...

How to register a winservice?

how to register a windows service within c#.net? ...