windows-services

Static Semaphore passed as member to Thread class instance = bug?

There are a few windows service projects in our codebase that follow this model, and I just want to make sure it's not a bug. In this model, there is at least one static "timer" class, managed by a System.Timers.Timer, that retrieves batches of data to process from the database. A Semaphore is initialized as a static member. After re...

Can a User DSN be accessed by a Windows Service

I've build a Windows service that allows a user to choose a DSN and the service will access it and peform tasks on it. The code works without error when running under a test command line application, and fails when running as the actual Windows Service. My question is, are Windows Services not allowed to access User DSN? Is there any ...

Install Windows Service with Recovery action to Restart

I'm installing a Windows Service using the ServiceProcessInstaller and ServiceInstaller classes. I've used the ServiceProcessInstaller to set the start type, name, etc. But how do I set the recovery action to Restart? I know I can do it manually after the service is installed by going to the Services management console and changing the...

HTTP Request problem in Windows Service

Hi guys We've written a Windows Service that needs to send an HTTP request in order to post some xml data to another server. When we test the code via a console application, it works fine, but when we test it by running it as a service, it errors on this line of code: var httpWebRequest = (HttpWebRequest)WebRequest.Create(Uri); The e...

Python Service Custom Command Arguments

I am currently working on a python program which runs as a windows service using win32service and win32serviceutil. The service runs as it should and even after using py2exe, everything is fine (the service monitors target folder(s) and autmotically FTP's newly created files to specified FTP location). I would like, however, to add some ...

Cant get Tomcat6.0 to work with Windows 7 Environment

Prior to upgrading to windows 7, I was able to use Tomcat 6.0, but when I upgraded to the new Windows, and downloaded Eclipse EE, and downloaded the apache content, I am unable to get Apache to run. When I attempt to start my apacher server through either system tray, or even windows services, it gives the followign error screen. "Windo...

ODBC and Windows Service

Hi, I'm new to windows services and... you guessed it, I’m a bit stuck. Let me paint the picture – I’m running a timed service that use an OdbcDataReader and SqlBulkCopy to (1) archive the data (2) normalize the data on a SQL box. When I run this code in a windows form proj. it works fine. Then, when I change the DNS’s Data Directory P...

Can't use Lambda expressions in Windows services?

I've developed a server software for .net 3.5 which I tried to convert to a windows service application. So I created a new Windows service project and added all my classes. But I can't compile it because it doesn't understand the lambda expressions i've used. I've checked so that all references are imported. But it seems like it isn't p...

How to configure WCF with NO security, and most minimal bindings

I've been having major problems with WCF, which are not amenable to any wisdom I can find. I've tried basicHttpBinding, wsHttpBinding, netTcpBinding (with the Net.Tcp service running on both machines). The behaviour can be boiled down to: works on same machine, when running in debugger, standalone (non-service) process, Windows service...

Writing values to the registry with C#

Hello, I'm in the process of creating a C# application which will monitor changes made to the registry and write them back to the registry next time the user logs on. So far I've got it monitoring changes, reporting them, writing the hive, key and value to a text file. I'm now at the point where I need to take them values out of the f...

Gracefully terminate WCF Service - complete all open sessions and restrict new sessions

I have a WCF Service that I have written, which is hosted within a Windows service. It is operating in PerSession mode. The service permits clients to open files, make changes to files and close files remotely through the service. So far all works very smoothly. When the Windows service is stopped, I would like to be able have the WCF S...

How do I grant a service user sufficient rights to create registry keys in windows 7

I have an application that runs as a service, and dynamically creates and publishes windows performance (perfmon) counters. When I run the application under my own account (as a service) which has administrative privileges, I get the following error: 714: The specified registry key is referenced by a predefined handle. When I run the a...

Automatically transfer Blog post (rss) in Facebook, Twitter...

Hi Any APIs or application that could be used to pull a RSS feed and put it on a configured Facebook, Twitter, ... account ? Kind of a Add This but in something like a Windows Service Thanks ! Patrick ...

What might cause an executing process from windows service to run slower than running from command line(admin)?

What might cause an executing process from windows service to run slower than running from command line? When I execute a process(another exe) from teh command line with admin rights, it is four times faster than when a windows service executes the same process. What could be causing this. Permissions on directories and files are okay f...

C# Windows Service - error 1053 the service did not respond to the start or control request

I've written a Windows Service in C# that basically checks my db every minute for orders, generates a PDF from these orders, and emails it. The logic works perfectly in my tests etc.. When i create the service, and install it using the setup project, when I go to start the service in the services mmc, I get: error 1053 the service ...

When creating a WCF Service with NetTcpBinding, use endpoint "localhost" or machine's host name?

I have a WCF service that uses the NetTcpBinding and is running within a Windows service. Remote clients connect to this service. So far, I have defined the endpoint to use "localhost". If the host machine has multiple network adapters, will it receive messages on all adapters? Would it be better to assign the machine's host name to t...

How can i find the current physical path where a custom windows service, resides?

Hi folks, i have installed my own custom Windows Service. I need to find out the physical path, where the service exists. eg. log4net.Config.XmlConfigurator.Configure( new System.IO.FileInfo(<insert path here> + "log4net.config")); Any ideas? ...

How to prolong the waiting period of a windows service shutting down?

Using RequestAdditionalTime for a windows service, does not prolong the waiting period long enough. I have to wait for a job to finish , so i keep on while (gs_bisProcessing) { OnRequestMoreTime(20000); Thread.Sleep(20000); } but still the job takes long enough that ...

When do windows xp services get started?

Hi, When a machine reboots, do all the services which are run under the accounts (system/service/network service) get run before a user logs on? JD. ...

Global exception handler for windows services?

Is there a way to globally handle exceptions for a Windows Service? Something similar to the following in Windows Forms applications: Application.ThreadException += new ThreadExceptionEventHandler(new ThreadExceptionHandler().ApplicationThreadException); ...