windows-services

windows service doesn't run at regular intervals

房东的猫 提交于 2019-12-23 04:43:07
问题 I have developed windows service for checking some services running or not for every two minutes.if the services are not running then start them automatically. here is my code public partial class Service1 : ServiceBase { public Service1() { InitializeComponent(); } protected override void OnStart(string[] args) { this.CheckServices(); this.ScheduleService(); } protected override void OnStop() { this.Schedular.Dispose(); } public void CheckServices() { log4net.Config.BasicConfigurator

How do I fix server Oops error when deploying Play Framework 2.0 application as a Windows service?

我的梦境 提交于 2019-12-23 04:09:12
问题 I was following the processes in this very helpful post: How do I run a Play Framework 2.0 application as a Windows service? when I ran into trouble in Step 9. When I execute runConsole.bat , the service cycles between the running and restarting states. The full log is here: wrapper.log but what jumps out at me in the log are the following: INFO|7268/0|play.core.server.NettyServer|13-12-28 13:07:28|Oops, cannot start the server. INFO|7268/0|play.core.server.NettyServer|13-12-28 13:07:28

Restart Windows Service in c#

跟風遠走 提交于 2019-12-23 03:52:10
问题 I got a link from SO Cannot restart a Service where it says to restart the windows service. The way it should restart the service is mentioned in the question as public static void RestartService(string serviceName, int timeoutMilliseconds) { ServiceController service = new ServiceController(serviceName); int millisec1 = Environment.TickCount; TimeSpan timeout = TimeSpan.FromMilliseconds(timeoutMilliseconds); if (!(service.Status.Equals(ServiceControllerStatus.Stopped) || service.Status

Restart Windows Service in c#

前提是你 提交于 2019-12-23 03:51:15
问题 I got a link from SO Cannot restart a Service where it says to restart the windows service. The way it should restart the service is mentioned in the question as public static void RestartService(string serviceName, int timeoutMilliseconds) { ServiceController service = new ServiceController(serviceName); int millisec1 = Environment.TickCount; TimeSpan timeout = TimeSpan.FromMilliseconds(timeoutMilliseconds); if (!(service.Status.Equals(ServiceControllerStatus.Stopped) || service.Status

WCF service self hosting with https

断了今生、忘了曾经 提交于 2019-12-23 03:33:13
问题 Currenlty there is a Wcf service hosted as windows service in one of our client side machine, actually currently this is working with normal http call. As we need to use https instead of http, for that we modified app.config but after starting the service the https url not working.Then we tried URL reservation by using netsh http add urlacl url=https://+:18732/Peripheral/ user=Everyone .Then we restared the service again it's not able to access the https url. we are getting the error in the

GDI Handles in Windows Service vs Interactive Application

喜夏-厌秋 提交于 2019-12-23 03:06:17
问题 I have a code that is used in an Winforms application. The same code is also used in a Windows Service (exe running as Windows Service). The code grabs the handles to ICONs. But what I found is that, in Task Mangaer (and GDI View), when I ran the Winforms Application the app shows the GDI count. But when I ran the code via Windows Service, the service instance in Task Manager isn't showing any count for GDI. So, does this mean that Windows Service can never hold a GDI handle? If so, how does

Where should Windows Services write Application Data?

橙三吉。 提交于 2019-12-23 01:19:20
问题 We have a Windows Service as part of our software, this is used to transfer data to a remote database in the background even when there is no user logged into the system. Currently this data is cached in the Program Files directory, and I don't think this is a good idea because it requires us to reduce the security permissions on our directories in Program Files. I think it should be caching this %LocalAppData% folder, so that we don't have to do this. What is considered best practise here?

Where should Windows Services write Application Data?

喜欢而已 提交于 2019-12-23 01:19:20
问题 We have a Windows Service as part of our software, this is used to transfer data to a remote database in the background even when there is no user logged into the system. Currently this data is cached in the Program Files directory, and I don't think this is a good idea because it requires us to reduce the security permissions on our directories in Program Files. I think it should be caching this %LocalAppData% folder, so that we don't have to do this. What is considered best practise here?

Windows Service - UnauthorizedAccessException

隐身守侯 提交于 2019-12-23 01:18:34
问题 I have a Windows Service created in .NET 4. I need to access a file from antoher server and I get an exception: "UnauthorizedAccessException was caught" - "Access to the path '(path)' is denied." If I make a new Windows Forms application which accessed that file, it works. The Windows Service runs as Local System. 回答1: Apparently your machine account does not have permissions to access remote file share. You have to grant rights to the machine account <DOMAIN>\<machine_name>$ on both file

Query all Windows Services with JNA

耗尽温柔 提交于 2019-12-22 19:14:09
问题 Currently I'm trying to query all installed Windows Services from (remote) machine. I had a look at win32.Advapi32 . But here I can only "get" a defined (I have to give a "ServiceName") Windows Services. (Advapi32.INSTANCE.OpenSCManager, Advapi32.INSTANCE.OpenService, Advapi32.INSTANCE.QueryServiceStatusEx) Do you know any API which allows to query all Windows Services from (remote) machine? EDIT:// I tried it allready with the following code. But it aborts hardly with no error message!