windows-services

Topshelf timeout issue

こ雲淡風輕ζ 提交于 2019-12-05 09:49:28
We are using Topshelf to host a service. Before starting the service, we are making database call to load lot of data. Because of this, while starting the service, we are getting following error: Start Service failed with return code '[7] ServiceRequestTimeout We are using following code to start the service: HostFactory.Run(x => { x.Service<AppService>(s => { s.ConstructUsing(name => new AppService(s_resolver, baseAddress, resolver)); s.WhenStarted(svc => svc.Start()); s.WhenStopped(svc => svc.Stop()); s.WhenShutdown(svc => svc.Shutdown()); }); x.EnableShutdown(); x.RunAsLocalService(); x

Create a windows service in vb6

独自空忆成欢 提交于 2019-12-05 09:08:45
Is it possible to create a windows service in vb6? if yes, how? I've never tried it, but Desaware offer a commercial package, the NT Service Toolkit that claims to allow you to host a VB6 DLL inside a Windows Service. Desaware was founded (and I think is still owned by) VB6 guru Dan Appleman, which is a good recommendation. Microsoft created a control to allow you to create services in VB6. http://support.microsoft.com/default.aspx/kb/170883 http://support.microsoft.com/kb/175948/EN-US/ Yes, it works, is it the best way to create a service, no, but if VB6 is a requirement (you have a bunch of

How reliable is windows task scheduler for scheduling code to run repeatedly?

a 夏天 提交于 2019-12-05 09:05:08
I have a bit of code that needs to sit on a windows server 2003 machine and run every minute. What is the recommended way of handling this? Is it ok to design it as a console service and just have the task scheduler hit it ever minute? (is that even possible?) Should I just suck it up and write it as a windows service? Since it needs to run every single minute, I would suggest writing a Windows Service. It is not very complicated, and if you never did this before, it would be great for you to learn how it is done. Calling the scheduled task every minute is not something I would recommend. I

Can you run a “service” that runs a scheduled task from an ASP.Net project?

十年热恋 提交于 2019-12-05 08:40:19
I built a Windows Service for a client of ours that collects all the changed/new rows from the database, turns them into a CSV and FTP uploads them somewhere every night. Now as it turns out they don't have access to install or run a Windows Service (it's a web path only hosted solution). I thought it would be easy enough to modify the Windows Service code to run inside the ASP.Net process and instantiated from the Global.asax (I've done this in the past, hosting a WCF service from within a MVC project). We're on ASP.Net 4.0, using web forms, and this task runs Quartz and OpenPG every night at

Is it possible to serve a web page from a self hosted web API in a windows service?

走远了吗. 提交于 2019-12-05 08:25:01
I have a perfectly normal (TopShelf hosted) windows service. I have a requirement for a simple interface to the service which will return some current stats (held in memory). I had a cunning plan to self-host a website within the service, and I see that the asp.net API has a self host functionality. Is it possible to subvert the 'API'ness of the system and have it return simple (though not static) HTML that a browser could read directly? If not that are there any other options or ideas for this scenario? Yes. This test site http://www.hypermediaapi.com is done using self-hosted WebAPI. The

Can't connect to Oracle from a windows service (error: ORA-12154: TNS:could not resolve service name (12154) )

ぐ巨炮叔叔 提交于 2019-12-05 08:21:47
LATEST Update (Nov 2 2011 9AM) I tried running tnsping from the service and it WORKS! However i still get error 12154 when i try to connect. I'm completely confused now, i can't understand how tnsping could work fine but the connection is unable to resolve the service name. For some reason when i run the following code from a windows service (on a timer event) I get the error: ORA-12154: TNS:could not resolve service name (12154) When i run the exact same code from a windows form app, it connects just fine. Both the service and the app are running under my account, so there is no difference in

Windows Service start and stop without admin privileges

吃可爱长大的小学妹 提交于 2019-12-05 08:12:15
How to start and stop window service without having admin privileges? My application launch should start my service same way it has to stop once it is closed. I can do this using "Service Controller " I can install the service with Admin privilege but for starting and stopping the service should not ask admin privileges. Can anybody tell me how I can achieve this using c#? I have discovered the way to give a permission to start/stop the service for non admin users. We can provide a group policy for our service so this can be start/stop without administrator privilege. I found two approach to

Stopping a multi-threaded windows service

和自甴很熟 提交于 2019-12-05 08:11:09
I have a multi-thread windows service in .Net 3.5, and I am having some trouble to stop the service properly when more than one thread is created. This service used to create only one thread to do all the work, and I just changed it to be multi-threaded. It works perfectly, but when the service is stopped, if more than one thread is being executed, it will hang the service until all the threads are completed. When the service is started, I create a background thread to handle the main process: protected override void OnStart(string[] args) { try { //Global variable that is checked by threads

Manually implementing IoC with a Windows Service

会有一股神秘感。 提交于 2019-12-05 07:55:19
I am brand new to IoC and thus have been following the examples provided by Jeffery Palermo in his posts at http://jeffreypalermo.com/blog/the-onion-architecture-part-1/ and in his book hosted here https://github.com/jeffreypalermo/mvc2inaction/tree/master/manuscript/Chapter23 Most important to note is that I am not using a pre-rolled IoC container, mostly because I want to understand all the moving parts. However, I am creating a windows service rather than an ASP.NET MVC webapp so I am little bogged down on the startup portion. Specifically, in the web.config he registers an IHttpModule

How to detect user activity with a Java service running on Windows?

删除回忆录丶 提交于 2019-12-05 07:54:12
My goal is to create a system monitoring application using Java. I would like to know when a user is doing activity on a Windows PC. The result would be something like this: 8:00 - 8:15 activity 9:12 - 10:29 activity 12:24 - 15:34 activity I'm not interested in any other information (which key was pressed, application used, etc.). Only user activity. Is this even possible in Java? I plan to run my java application as a service. But as for getting events when a user uses the computer, I have no idea where to start. [Edit] Further clarifications: I'm not interested in the details of the activity