windows-services

Specify LoaderOptimization's for Windows Services

How do we specify LoaderOptimizations when we are building a Windows Service, we don't have our "Main" method as we would otherwise use In other words, when we have a simple console application we can: [LoaderOptimization(LoaderOptimization.MultiDomainHost)] private static void Main(string[] args) { } but for a Service, we implement...

Manage remote service using alternate credentials

--Update-- I have to admit that I was sceptical it would work... but below is the code. I had to make a minor change to the code you suggested. Whenever I tried IPC$ it would return a 53 result code, even though I'm sure the share exists. So at the suggestion of another website I removed the share and just the computer name and this ...

How to implement a Windows Service to manage Session state?

I'm working on an ASP.NET MVC web application that will be deployed across multiple load-balanced servers. With this setup, a user might have one request served by server A and the next request will be served by ServerB or ServerC. We don't want to store Session Data in the database, as we're trying to minimise database hits where ever...

Can't add a reference to System.Web to my Windows Service aplication

Hi I'm trying to create a Windows Service in VS2010 but can't seem to add System.Web as reference. When I browse for it and add it manually I get an exclamation mark over the reference. I've tried adding it for other projects and it works fine, just not for a windows service project. Is there a reason for this? I need it to call System....

Windows service startup causing a windows error

We have written a custom windows service (VB.NET, .NET Framework 2.0) that takes a while to start up, because it uploads sales. Protected Overrides Sub OnStart(ByVal args() As String) -- upload sales here End Sub That fact that it takes a long time to start up is fine, but that generates a time-out error in Windows and another progr...

Windows Service Multi Core Utilisation

We have an number of old visual C++ 6 windows services that are currently running on a single server. The problem seems to be that all of the service seem to utilise only a single core. (There are 4 cores) Isn't the multi core utilisation (on windows server 2003) supposed to be optimised by the OS? ...

Health Monitoring and Windows Services .NET

Can I use health monitoring with Windows Services .NET ?? I was wondering if you can enable Health Monitoring for WebSites and WCF Web services. I'm hosting a number of services in IIS and configured it to send the team email notification when any exceptions are thrown or another events. AppFabric monitoring all WCF Services. But nothin...

Windows service locks up on assembly load

I have a Windows Service written in C#. It includes a standalone console mode as well, for debugging purposes. It works fine on almost every computer it's been run on, but we ran into a situation where this service locks up when you try to start it, and then it gets killed because of timeout. But when running it in console mode on the...

Why can't I use a UI component (Windows form) inside of a Windows service?

I've seen several posts that essentially state that UI components shouldn't run as a service. I understand the rational that no one can respond to UI events etc. But the fact remains that are are many automation tasks that are only possible with Windows forms. Here is a couple of great examples: I would like to build a url crawler se...

Communicating with a Windows Service

I'm looking for the best way to use a Windows Service to manage a group of objects for use by several different client programs. The service must 1) create the list of objects corresponding to physical or virtual devices, 2) maintain information about what process is currently using a given device and what devices are available to be us...

Implement windows service

Hi all... I want to implement birthday reminder windows service with globalization concept... Mean if user is in us then according to us time birthday mails should get fired.. ...

Cannot reference dll in windows service

Hi! I've created a windows service in VS 2010 which references the model conveniently placed in a separate project which compiles to a dll. I have no problem referencing this dll in other parts of my solution (web apps), but in my windows services the following symptoms display: Compiler error: The type or namespace %%% cannot be foun...

C# Worker process garden framework

Here is the situation, I have a worker process that is automating Internet Explorer (via AxSHDocVw). This worker process is launched via a custom Windows service on the OS shell. I need to run somewhere between 4-8 of these worker processes to handle each batch of work in timely manner. I really don't want to have to tear down and recrea...

Windows service using a lot of CPU (VB.NET)

HI, We have a device on the field which sends TCP packets to our server once a day. I have a Windows service which constantly listens for those packets. The code in the service is pretty much a carbon copy from the MSDN example (Asynchronous Server Socket Example) – the only difference being our implementation doesn't send anything back...

Poweshell installing/uninstalling windows services on a remote machine

I am using powershell 1.0 and I need to install a service on a remote machine and first uninstall it if it exists. This is my script I have that installs the service, however, I seem unable to uninstall the service. I have tried installutil however the service path is a network path which installutil, throws errors over. I'm a complete...

Log4Net with WCF Running As Service

Hello To All, I am running a WCF Service as Windows Service. I am having trouble getting log4net to do any actual logging In what app.config should I place my configuration code for log4net. The Service Host app.config the Service app.config or the underlying methods that the Service Calls? -b ...

Print Job Accepting and routing Software

I want to create a software which can accept Print Jobs from other computers, and then route those print jobs to PCs on LAN with printers attached. How it's going to happen -> 1- When that software called "Virtual Printer" is installed on a computer "X", Windows should think that it is a print driver/attached printer to that computer. ...

Restart a windows services from C#

How do I restart a currently running service in C#. ...

Windows service

Hi all.. I have written onw windows service..in that i have logic that is some part of code need to execute on certain time.. my service is running in every one min.. e.g. If (DateTime.Now.ToString("MM/dd/yyyy hh:mm") = "7/23/2010 1:10 ") Then 'execute this logic End If But iam facing prob that it is considering seconds whil...

Windows Service Stops Unexpectedly

Hi All, I've written a windows service in C# which for the most part sits very nicely and processes away, but it seems that with load it becomes liable to stop unexpectedly. It basically feeds records from a database with a timestamp, queues them fires off another process at the correct time. It just stops completely, doesnt raise any...