windows-services

Show a message box from a Windows Service

Can you display a message box (or any form of notification) from a windows service? Can't get it to work. I used: global::System.Windows.Forms.MessageBox.Show("A fatal error occurred. " + ServiceName + " is now terminating."); but it didn't work and just produced an error. ...

Adding IoC Support to my WCF service hosted in a windows service (Autofac)

I'd like to setup my WCF services to use an IoC Container. There's an article in the Autofac wiki about WCF integration, but it's showing just an integration with a service hosted in IIS. But my services are hosted in a windows service. Here I got an advice to hook up the opening event http://groups.google.com/group/autofac/browse_thr...

Acceptance Tests for a Windows Service

I'm writing a windows service that processes a number of different rss news feeds at regular intervals. These news items will be saved into our database and associated with different objects in the system. Although there is a set specification on what needs to happen, there is no UI component for the customer to verify. What's the best...

Advice on using .Net WorkFlow State Machine. What would you do?

So I've been tasked at work to write windows services to replace some old legacy VB6 WinForms apps currently running as services, consistently repeating tasks day-to-day. To give some general background, they have there own state machines built in to handle decision basing and not utilizing threading. A lot of the senior developers here...

How would I access the Windows Login (Authentication) API from a C++ Service Application?

Let us imagine for a moment that I have a piece of hardware that can act as an authentication for a user on a given system. I want to write an application in C++ to run as a service, look for this device and if found log the appropriate user in. I believe I have found the API's I would need to use to perform the hardware and service port...

How can I debug a Windows service that crashes?

I have a .NET Windows service that appears to be crashing due to C00000005 (access violation--according to Dr Watson). When I attach the VS debugger to it--whether I build it with or without symbols--the VS debugger just stops when the service crashes, instead of stopping to give me a chance to do any investigation. Is that to be expec...

Shutting down a windows service that has threads

I have a windows service written in .NET 3.5 (c#) with a System.Threading.Timer that spawns several Threads in each callback. These are just normal threads (no Thread Pool) and I've set the IsBackground = true on each thread since I'm only going to be running managed code. When a user stops the service, what happens to all the threads? ...

Enclosing service execution in try-catch: bad practice?

Hi, Below is the usual Program.cs content for a windows service program: static class Program { /// <summary> /// The main entry point for the application. /// </summary> static void Main() { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new MyService() ...

CruiseControl.NET run as a windows service and as a standalone process behaves differently

I have a project that is being built using CruiseControl.NET. The project contains an 'MSBuild task' that runs the build for the project and also the unit tests. The unit test in turn is just a MSBuild 'exec' task that runs an executable. The unit test involves some .NET remoting. And when the unit tests are run through the system comma...

How can i start windows service automatically

i try to develop a windows service. My win service must run if windows 7 stars up. How can i do? ...

scheduled task or windows service

Hello, I have to create an app that will read in some info from a db, process the data, write changes back to the db, and then send an email with these changes to some users or groups. I will be writing this in c#, and this process must be run once a week at a particular time. This will be running on a Windows 2008 Server. In the past,...

CeSetUserNotificationEx with named event and CNT_TIME fails under services.exe

I have a service application, a simple dll running under services.exe. I can attach the VS debugger to services.exe, activate the service application dll and then single step it in the debugger without any problem. Now, I try to use CeSetUserNotificationEx to be notified at a certain time in the future. I use the CNT_TIME trigger type w...

My Windows Service cannot write to the Application Event Log

I have 2 Windows services installed. They both have the same configuration for enterprise logging. 1 Windows Service successfully logs to the Application Event Log while the other one does not. The one that does successfully post to the log I see errors being generated. For the service that does not log successfully we see Service St...

How does tomcat set its executable file as a windows service?

Firstly, I am not at all familiar with windows batch file programing. Recently I am curious about how tomcat sets itself as a windows service using a batch file. I downloaded the service.bat file from tomcat 6. However, I still don't understand some part of it. I guess this is the line that the batch actually register the exe file to th...

Multiple windows services in a single project = mystery

I'm having a bizarre issue that I haven't seen before and I'm thinking it MUST be something simple that I'm not seeing in my code. I have a project with 2 windows services defined. One I've called DataSyncService, the other SubscriptionService. Both are added to the same project installer. Both use a timer control from System.Timers....

strange nhibernate exception?

Hi i am gettin a strange exception in may windows service application, but it was working fine for a long time and suddenly gave this error: "(0xc0000005 at address 5A17BF2A): likely culprit is 'PARSE'." 2010-05-11 07:00:03,154 ERROR [0 ] [NHibernate.Cfg.Configuration.LogAndThrow] - Could not compile the mapping document: xxxx.hbm.xml...

Having problem with a crawl service in .net: Server not responding to IP ping. Is it bandwidth or http connection limit exceeded?

Hi to all I develop web crawling service (windows service / multi-thread) . its work fine, but sometimes my server network not response. and i can't ping server IP (from internet), but can ping by other network card (local ip) that not access to internet. after i open server with remote desktop and stop crawling service. i could ping....

How to find windows service exe path

Hi, I have a windows service and I need to create directory to store some info. The directory path must be relative to the windows service exe file. How can get this exe file path ? ...

PowerShell script to restart a service

My mission is to press a keyboard sequence, such as Ctrl +Shift +R, to restart a Windows Service. I have a script which works fine in the PowerShell ISE, when launched with administrative privileges. When I try with a PowerShell script it fails due to insufficient Administrative Privileges. It’s galling that I can get it to work with ...

AppFabric for caching

It is possible to use appfabric for non web/asp.net caching ? say instead of ncache/memcached etc. ...