windows-services

Windows Service doesn't start automatically

大兔子大兔子 提交于 2019-12-07 13:24:19
问题 I have a windows service written in .Net 3.5 set to be automatically start, but it wouldn't start when system reboots. As I understand, it may be caused by my service's dependency aren't started when the services tries to start. I don't know what my service depends on. I tried the workaround by adding windows print spooler as one of my service's dependencies, since print spooler is one of the services start quite late during the boot-up. Well, the work around doesn't work neither. I'm using

Windows Service in .net cannot resolve tns service name

泪湿孤枕 提交于 2019-12-07 12:46:18
问题 I have moved a component of our application from a webservice to a Windows Service. It connects to oracle perfectly from the webservice but refuses to see the Tns names from the Windows service. I have given full control to the ORAHOME dir to the account the service is running under. I have also checked the service account permission to the registry by using runas regedit as the service account and it can see HKLM\SOFTWARE\ORACLE\HOME0 details and HKLM\SOFTWARE\ORACLE\ALL_HOMES. All the

How to pass parameters in windows service from Installer to Main function in Program.cs?

牧云@^-^@ 提交于 2019-12-07 12:29:11
问题 I have successfully passed parameters from Installutil to my serviceinstaller but i cannt seem to pass these parameters to the Main(string[ args] function. Here is how i am trying to do this ....if there is any better wayto do what i am doing please let me know protected override void OnAfterInstall(IDictionary savedState) { base.OnAfterInstall(savedState); string[] args = new string[2]; args[0] = Context.Parameters["username"]; args[0] = Context.Parameters["password"]; new ServiceController

Problem stopping Windows Service from Installer Class. Events fire too late

久未见 提交于 2019-12-07 12:12:00
问题 I'm using Visual Studio 2010 with .NET 4.0. I have a windows service that is installed from a Visual Studio Setup Project. In the setup project I have the RemovePreviousVersion property set to True. In the project that contains the service I have an installer class that will be used to stop the service when upgrading from a previous version. So when upgrading the software the service will already exist and could be running. If it is running then during the installation the installer prompts

Changing the service's startup-type (Windows)

天涯浪子 提交于 2019-12-07 11:14:12
问题 I was searching for ways to change the start-up type of a Windows service and I found 2 ways to do this... By editing the Registry Or By using the WMI classes I want to know which one is the best... I want my application to run properly on both Windows and Vista. 回答1: You can also use the win32 API directly. I'd definitely recommend the WMI class; it makes it most likely that if there are changes in future versions of windows that your code still works. 回答2: I you want to be safe for future

Install Kafka as windows service

£可爱£侵袭症+ 提交于 2019-12-07 10:54:51
问题 How can I install and run Apache Kafka as windows service? Right now I need to go to command prompt and start zookeeper and kafka server. Is there any way so that I can install Apache Kafka as Windows service? I saw only below blog but don't know what they mean by "Adjusts the settings for a Windows environment" and "Build the project in Release mode" http://www.lukemerrett.com/2015/12/01/apache-kafka-windows-service-wrapper/ Thanks! 回答1: Perform all the pre-requisites and installation steps

Using RegisterDeviceNotification in a .NET app

心已入冬 提交于 2019-12-07 10:29:29
问题 I have seen some examples on how to use RegisterDeviceNotification from the Windows API, but I have not seen any .NET examples. I want to write a C# app that is notified when a new drive appears (specifically through USB, firewire, etc). This app needs to be a Windows service, so I can't use WM_DEVICECHANGE messages without some bad-practice hacking. I'd like to avoid that. Can anyone give me a sample of how to use RegisterDeviceNotification in C#, or at least give me a good alternative to it

Two way communication using Cromis IPC

折月煮酒 提交于 2019-12-07 10:29:13
问题 I've downloaded and had a play with the Cromis IPC components from Iztok Kacin. I've downloaded this component set to allow my windows service and GUI to communicate. However it seems that the communication is one way(apart from server responses). I can quite happily send a message from a client to a listening server, but I don't appear to be able to send a message back to the client unless it is as a response. Does anyone know if two way comms are achievable with these components or am I

Windows Service with multiple timers

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 09:59:53
问题 I have been given a windows service written by a previous intern at my current internship that monitors an archive and alerts specific people through emails and pop-ups should one of the recorded values go outside a certain range. It currently uses a timer to check the archive every 30 seconds, and I have been asked if I would be able to update it to allow a choice of time depending on what "tag" is being monitored. It uses an XML file to keep track of which tags are being monitored. Would

windows service sql connection problems

倖福魔咒の 提交于 2019-12-07 09:50:19
问题 I need your help !!!! I want to connect to sql server from a windows service, but it throw following exception : Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. My connection string is declared as follow: <add name="CoreConnectionString" connectionString="Data Source=10.10.2.102;Initial Catalog=DataBaseName; Integrated Security=True" providerName="System.Data.SqlClient" /> When I use user name and password instead of Integrated Security=True It works but in final deployment I cannot use