Is there a standard way in .Net to access and modify the windows services file? Right now I'm just accessing the file via a stream and writing to the file like I would for any other file. The file is located in c:\windows\system32\drivers\etc\, but I'm worried that this may change in 64 bit versions of Windows or may vary in different ve...
I have created a windows service and installed it manually. Later started the service from Services tool. Now I want to dubug the windows service application from Visual studio IDE.
When I try to attach the process from Debug tab in the IDE, the windows service process is shown in the list, but it is not highlighted to be attached.
Is t...
I have a custom-written Windows service that I run on a number of Hyper-V VMs. The VMs get rebooted a couple times an hour as part of some automated tests being run. The service is set to automatic start and almost all of the time, it starts up fine.
However, maybe 5% of the time, with no pattern that I can discern, the service fails to...
I have a ASP.NET website in which a user makes a request. Every request kicks off a long process that may take several minutes (worst case of 20 mins). At the end of the request a file is created for the user to download.
Currently, I have this request kick off the process asynchronously (using Async pages) but I am getting time out err...
I created a .NET windows service that installs without any issues on the dev machine. On the server that has only the .NET framework (and no VS installed), since I don't have the VS 2008 prompt, I did the following.
I opened the command prompt
I did cd C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727
I attempted to install the service u...
In a Windows Service, I need to detect when the computer goes into sleep and when it wakes up, and run some code on these events. This needs to be done for sleep, standby and hibernate power modes.
How do I do that ?
...
I have a C# windows service which is running under the NetworkService account. It occassionally needs to print a Chart object which I do by simply calling:
chart.Printing.Print(false); // suppress the Printer Dialog
The weird thing is it seems works fine running as a console application.
The only way it will work is if I run the serv...
Is it possible to create a windows desktop shortcut that will restart a windows service?
I'd like a button to restart my apache service after I have made changes to the config file.
...
I try to follow http://edn.embarcadero.com/article/28604 for restarting Interbase.
Here is some code:
program IBRestart;
{$APPTYPE CONSOLE}
uses
SysUtils, winsvc;
var
vManager, vService: SC_Handle;
vtmp: TServiceStatus;
begin
vManager := OpenSCManager(nil, nil, SC_MANAGER_ALL_ACCESS);
if vManager > 0 then
begin
vServi...
We have a Windows service written in C#. it is crashing after running for sometime about 5-6 hours.
Our C# Windows service calls Un-Managed code which is a COM component.
The only error information I get from Event Viewer is:
Faulting application application.exe, version 2.2.2.0, stamp 45ed8d14,
faulting module comcomponent.dl...
I have created a Windows Service that will be calling out to some COM components, so I tagged [STAThread] to the Main function. However, when the timer fires, it reports MTA and the COM calls fail. How can I fix this?
using System;
using System.Diagnostics;
using System.ServiceProcess;
using System.Threading;
using System.Timers;
n...
I'm having an issue that I can't figure out regarding a Windows Service I have written in C#. What I am trying to do is wait for a specified period for a child process to terminate before I am forced to kill it and stop the service. I have set my timeout for anywhere from 5 to 15 seconds and my service waits the appropriate amount of t...
In order to perform basic charting from a windows service (win32 API) including the generation of bar charts from text file data (saved as .jpeg for instance), I'm stuck about whether .NET 3.5 has this ability built in.
For charting, which references should be added and/or which using statements included?
Even a nudge in the right dire...
I have been doing some extensive testing of a Windows Service I have been writing in C# .Net 3.5. I am having trouble getting Windows to give me enough time for my service to shutdown properly when I restart or shutdown the computer even though I am invoking the RequestAdditionalTime() method which should update the SCM and keep my serv...
I have created a console application in .Net 2.0 (C#) and want to create an installer that will install the application as a Windows Service.
I have never created an installer before but I am reading a few articles on the subject. I would appreciate any suggestions or links from those with some experience in this area.
Thanks.
UPDATE...
We have had a web application product for several years, and used Tomcat to deploy it under Windows as it registers itself as a Windows service so it starts and stops automatically.
We may now happen to need more JEE facilitites than is provided by Tomcat (we are very tempted by the JEE 6 things in the container) so the question is whic...
I have a Windows Service that hangs when opening an OLEDB-connection to an Excel-file, like this:
using (var connection = new OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
+ fileName + ";Extended Properties=\"Excel 8.0\""))
{
connection.Open();
// start using the connection
}
This code works fine when r...
I have a Windows Service written in C# (.Net 3.5) and I need to store some state somewhere so that next time the service starts up, it knows where it left off.
What is the recommended store for this type of thing? The registry? What if I just put some user settings in a Settings.settings file? Where would the user profile be for a servi...
Hi,
I want to call a Business layer method from a Windows service (done using C# and .NET) after every 10 seconds. However, i dont want to use the Timer_Elapsed event since it starts up another thread/process if the first thread/process is still running. I just need a single threaded approach, since multiple calls to the same Business m...
Hello all,
Our company just completed a Win 32 Application project, and we have a executable program and it works fine in Windows. Now we have to run it as a windows service under Network account. I am pretty new to Windows Service, so please advice, what should I do to transform this program to a Windows Service? Thank you!
...