windows-services

How to install a Windows service developed in .NET 3.5?

江枫思渺然 提交于 2019-12-20 10:48:05
问题 I have developed a Windows service using Visual Studio 2008. I want to install that service in a machine where Visual Studio is not installed, but .NET 3.5 is installed. Generally InstallUtil.exe shall be used for installing a Windows Service, but the InstallUtil.exe utility is not available in .NET 3.5. When I tried installing that service using .NET 2.0, the service is getting displayed in the list of services but when starting the service Windows Service error 1053 is coming. How we can

Windows Services Recovery not restarting service

梦想与她 提交于 2019-12-20 10:46:08
问题 I configure the recovery for Windows services to restart with a one minute delay after failures. But I have never gotten it to actually restart the service (even with the most blatant errors). I do get a message in the EventViewer: The description for Event ID ( 1 ) in Source ( MyApp.exe ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve

Path to the executable of a windows service

丶灬走出姿态 提交于 2019-12-20 10:38:08
问题 How can I get the path to the executable of a specific windows service from another program ? Unfortunately the class ServiceController (System.ServiceProcess) doesn't provide a method or property for that ! 回答1: There's always the WMI class Win32_Service as described here, specifically the PathName . This works: ManagementClass mc = new ManagementClass("Win32_Service"); foreach(ManagementObject mo in mc.GetInstances()) { if(mo.GetPropertyValue("Name").ToString() == "<Short name of your

Windows command to get service status?

て烟熏妆下的殇ゞ 提交于 2019-12-20 09:35:36
问题 I need to know the status of a service at the end of my batch script which restarts services using "net stop thingie" and "net start thingie". In my most favorite ideal world, I would like to e-mail the state to myself, to read on cold winter nights, to reassure myself with the warmth and comfort of a server that I know is running right. Just for you to know, I'm using a Windows server 2003 platform, and a batch file seemed the best choice. I don't mind using something else, and would be very

How can I install a windows service onto a machine that doesn't have Visual Studio installed?

◇◆丶佛笑我妖孽 提交于 2019-12-20 09:16:19
问题 The only way to install windows-service I know is using " Visual Studio 2008 Command Prompt ", Is there a way to install windows-service on a machine which isn't having Visual Studio installed (assume that .Net version 2.X is installed.) 回答1: you can do it with installUtil which resides in the .net framework folder (on my machine it's C:\Windows\Microsoft.NET\Framework\v2.0.50727). 回答2: You can install Windows Services as an MSI. Create the MSI as a normal Project attached to your Service

How to uninstall a Windows Service when there is no executable for it left on the system?

蓝咒 提交于 2019-12-20 08:18:27
问题 How do I uninstall a Windows Service when there is no executable for it left on the system? I can not run installutil -u since there is not executable left on the system. I can still see an entry for the service in the Services console. The reason for this state is probably because of a problem in the msi package that does not remove the service correctly, but how do I fix it once the service is in this state? 回答1: You should be able to uninstall it using sc.exe (I think it is included in the

Why windows service not start automatic after windows start

纵然是瞬间 提交于 2019-12-20 07:24:31
问题 Why windows service not start automatic after windows start. I set service installer property start type to automatic. Is there other property which need to be set? Logon for service is local system account. And service can be started manually every time. 回答1: This happens most often when a resource needed by your service is not available when Windows tries to start it. Please review what your service needs to operate and ensure that you setup a dependency for each resource required. For

Should I block even when I'm sequentially processing

限于喜欢 提交于 2019-12-20 07:08:23
问题 I have a windows service that periodically needs to do some work. So I set up a System.Timers.Timer to do this. Lets assume that its possible that the processing time could be greater than the timer interval. Lets also assume it would be a very bad thing if this happens. To avoid this I'm setting the AutoReset on the Timer to false and then calling start in my process. public partial class Service : ServiceBase{ System.Timers.Timer timer; public Service() { timer = new System.Timers.Timer();

Should I block even when I'm sequentially processing

冷暖自知 提交于 2019-12-20 07:08:11
问题 I have a windows service that periodically needs to do some work. So I set up a System.Timers.Timer to do this. Lets assume that its possible that the processing time could be greater than the timer interval. Lets also assume it would be a very bad thing if this happens. To avoid this I'm setting the AutoReset on the Timer to false and then calling start in my process. public partial class Service : ServiceBase{ System.Timers.Timer timer; public Service() { timer = new System.Timers.Timer();

Ninject, DbContext & Windows Service - New Instance Each Time Thread Runs?

空扰寡人 提交于 2019-12-20 06:16:52
问题 I'm current writing a Windows Service which connects to an existing service layer using Entity Framework (DbContext), and Ninject to inject the Respositories and DbContext instance. This is pretty much working with one caveat - I want a brand new DbContext instance each time the thread runs, whereas at the moment I'm getting the same one for the entire thread lifetime. My binding looks like this: Bind<IDbContext>().To<EnterpriseDbContext>().InThreadScope(); Bind<IUserRepository>().To