windows-services

How to verify if a windows service is stopped or running and wait until it is in this state?

How to verify if a windows service is stopped or running and wait until it is in this state? Dim s As New ServiceController("Aservice") s.Refresh() If s.Status = ServiceControllerStatus.Running Then s.Stop() End If s.Refresh() The problem is that I want to wait in this function until the service is in that sta...

How to make a Web (WCF) Service act as Windows Service

The question, I have a web application - .net 4. The client is having a requirement that he want to send email to his users on a regular basis about his new courses etc. The webapplication created will hosted on a "Shared hosting environment" with no excess to windows services - file system other than the web root folder through FTP....

Error Message With Installer of C# Windows Service

Here is the error message: The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2869. The arguments are: ErrorDialog, I found another link related to the problem. The link here Will cleaning the registry work. I tried the tool mentioned there but it...

Quartz.net - Trigger not firing when scheduler runs inside a Windows Service

I've got a class library (c#, .net 4.0) implementing a wrapper class for a Quartz.net Scheduler and a bunch of Triggers and Jobs which I'd like to have executed. This wrapper class has a simple Start() and Stop() mathod to start or shutdown the Scheduler. When I instanciate my wrapper from a console application, it registers my Jobs + ...

Amazon EC2 for WCF Windows Service

Dear Gurus I have a Sync Services built using .Net WCF, .net 4.0,SQL Server 2008 and hosted in a windows service. Following are some custom implementation we have done; Custom DB Connection Pooling, filled on the start of Application, and there is a cleanup thread as well which runs through out the life cycle of application. Custom ...

How can I prevent a pop-up asking to shut down services before uninstalling

I have a WiX installer that runs a program that downloads the latest version of my code and installs three windows services. I have a custom action runs another program that shuts down and uninstalls the services during uninstallation, after InstallInitialize. The uninstaller also deletes all files and directories that get downloaded. Ho...

.NET windows service randomly stops and will not start due to a login failure.

Hi everyone, I created a service which monitors a few servers and file shares for exchange. Written in VB.NET 2. The service is installed and running fine(ish) but randomly and without any warning or entries in the event log it stops. Upon noticing it stops (the web front end that it generates stops working) we have to manage ther hos...

How can I free up a DLL that is referred to by an exe that isn't running?

I've got a windows service that relies on a DLL. Whether the service is running or not, its executable is keeping a handle to that DLL, which is preventing me from updating it automatically. Why is this, and how can I remove that handle programatically (preferably via .Net)? Update: I know that the service's executable is the one with ...

What's the best way to signal threads that sleep or block to stop?

I've got a service that I need to shut down and update. I'm having difficulties with this in two different cases: I have some threads that sleep for large amounts of time. Obviously I can't wait for them to wake up to finish shutting down the service. I had a thought to use an AutoResetEvent that gets set by some controller thread when...

Error 1053 When Starting Windows XP Service Running Mongo DB 1.6.3

I'm trying to set up MongoDB 1.6.3 on my Windows XP SP 3 machine. I've followed the instructions from the MongoDB wiki. I can see the Windows service installed but not started. The path to the executable looks like this: "C:\Tools\mongodb-win32-i386-1.6.3\bin\mongod" --bind_ip 127.0.0.1 --logpath c:/mongodb/logs/mongodb.log ...

Windows Services Framework??

Are there any good frameworks or templates for developing Windows Services? I generally don't write windows services and hoping someone has shared their expertise via an api or example project. I am working on a project with the following requirements: **A windows service that:** performs 1..many independently scheduled tasks reports o...

A windows service application controlled by desktop appplication?

Hi , I created a windows service in C# where I can start , stop, restart. Is there anyway of creating a simple desktop application to control it. example: button to start service button to stop... thanks ...

How to start stop Windows Services using Scripting Language like Vb Script or something?

I Just want to manage Windows Services through Scripting languages( VB Script or Something ). Like Starting, stopping, Getting the status, Checking the dependencies etc. Please help with Code snippets or URL referances. ...

Proper Queue threading technique in c#?

I wanted to implement a windows service that captures dropped flat delimited files to a folder for import to the database. What I originally envision is to have a FileSystemWatcher looking over new files imported and creating a new thread for importing. I wanted to know how I should properly implement an algorithm for this and what tec...

Service unable to read messages from queue after moving to new machine

This Windows Service reads email from the MSMQ. It was reading mail when deployed to Windows Server 2003. After being moved to Windows Server 2008, it has stopped reading email. It does not write any logs to the file. When the Windows Service is started, nothing happens. Please anyone could tell me what could be wrong. Do I need to con...

Why does my Windows Service automatically quit after approx 5 secs?

I've create a Windows Service using C# that when OnStart is called creates a new thread from another class. This new thread then loops waiting for any incoming TCP connections. Or it should. When I start the service it automatically stops after about 5 seconds. I don't know why it is doing this. I understand that services close on their ...

.Net Windows Service - NT Authority\System - Login Failed

We deploy software on a dedicated server. It's a Windows 2003 server with SQL Server 2005 and IIS. We have four .Net Windows Services that run on the server. At one client location two of the four services are failing to connect to the database following a reboot. The error for both is "Login failed for user 'NT Authority\System'"...

Windows application or service to communicate with another service on remote desktop

Hi, I need to write an application in C# that has to communicate with a service on a remote desktop. I would like to know if it will be better to write an application that sends information to a local service which in turn communicates with the remote service or would it be better for the application itself to communicate with the remot...

How do I resolve process hanging on CoUnitialize()?

I have a native Visual C++ NT service. When the service is started its thread calls CoInitialize() which attaches the thread to an STA - the service thread uses MSXML through COM interfaces. When the service receives SERVICE_CONTROL_STOP it posts a message in the message queue, then later that message is retrieved and the OnStop() handl...

Should the first call to a WCF service take an extraordinary amount of time?

I've got a WCF service operation that just does a LINQ query on a SQL database, looking up 1 of 35 records that have a matching Guid (it's really as simple as it gets). When I call this method from a simple sandbox application, it comes back right away. However, when I have it running in a windows service, the first call to the method ta...