windows-services

Service installation fails as event source already exists

眉间皱痕 提交于 2019-12-14 03:00:34
问题 I'm trying to configure a Topshelf-based Windows service to log to a custom event log using Topshelf.Log4Net and log4net. This works fine if I run the application in command-line mode. When I try to install the service with BillsTestService.exe install , I get: INFO Topshelf v3.1.107.0, .NET Framework v4.0.30319.18052 DEBUG Attempting to install 'BillsTestService' Running a transacted installation. ... Service BillsTestService has been successfully installed. Creating EventLog source

how to start the MYSQL service before my Windows service

北慕城南 提交于 2019-12-14 02:36:58
问题 I have the windows service program which runs and sometime throw exception about system null reference. After my investigation, this is due to MySQL connection cannot establish due to MySql instance not up yet when startup computer. How to solve this problems??? thanks in advance 回答1: You can set in Windows the dependencies of each service. You can go into Control Panel -> Administrative Tools -> Services (or run 'services.msc' from the command line). By double clicking any of the services

Scheduler for Web application ASP.NET MVC [closed]

不羁的心 提交于 2019-12-14 01:21:11
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I've built a website application by ASP.NET MVC that helps user get RSS news. Of course, it works perfectly. However, I want to expand the function that the website will automatic send hot news to user's email at 6.00 am daily, for example. I've found solutions on internet but I

Running batch script as windows service

允我心安 提交于 2019-12-14 00:42:47
问题 We have a java application which run as server running on a remote windows system which is started though a batch script which includes some initialization configurations. To avoid login into the system every time and starting / stopping the service I planned to add that batch script as a "Windows Service" and use it remotely through command prompt. After number of failed attempts I came to know there is no simple way of doing it without using third party software which I am not allowed to to

Windows Service running but event logs not working

安稳与你 提交于 2019-12-13 18:02:47
问题 I have a windows service listening to messages from a queue but the messages are not read from the queue.I created an event log to check for logs during service startup and shutdown but the logs are not written. I do not want to debug the service since it is a painful process.Is there a way to solve this issue.The messages need to be read by the service and written to a database. 回答1: This certainly sounds as if the account that your windows service is running under doesn't have enough rights

Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot

故事扮演 提交于 2019-12-13 18:01:27
问题 I am trying to get a windows service to work but I keep getting the following error... Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. The windows service is pretty simple. It looks at some data, does some organization and sends some information of to a database. If the data meets certain conditions, the service connects to K2 Workflow, find the correct item, then claims and completes

Is it possible to get user input in Windows Service C#

大兔子大兔子 提交于 2019-12-13 16:07:21
问题 I'm developing a Windows Service in C#. One of my requirements is to get some user input: to present some options and let them select one; based on their choice, the service should perform an associated operation. Is it possible to get user input in a Windows Service, with C#? 回答1: No, a Windows Service is not designed for that. You would need to use a desktop or web application. If there is a good reason to use a service, you would need to create an application and have it send or

wix: re-start an existing Service when install/uninstall finish

无人久伴 提交于 2019-12-13 15:49:43
问题 I would like to re-start a running service when my installer finish installing or uninstalling. I have found this code: <ServiceControl Id="SomeUniqueId" Name="NameOfTheirService" Start="both" Stop="both"/> But where do i attach this code to ? to the component where my is placed ? Code: <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="325c4bfd-6614-43e9-aedb-93661295352d" Name="Plugin" Language="1033" Version="1.0.0.0" Manufacturer=

Call to native DLL fails from a .NET Windows service

蓝咒 提交于 2019-12-13 14:03:07
问题 I have a 3rd party API in the form of a native dll that I call from C# using DllImport . This native dll depends on the 3rd party application being open. When I run the code normally the API does what is expected and drives the application. However, when I run the same code as a Windows service, even as myself, the API returns the same (undocumented) error code that I have seen when the application is closed; process explorer confirms that the native dll is correctly loaded from the

How do I resolve process hanging on CoUnitialize()?

久未见 提交于 2019-12-13 13:31:45
问题 I have a native Visual C++ NT service. When the service is started its thread calls CoInitialize() which attaches the thread to an STA - the service thread uses MSXML through COM interfaces. When the service receives SERVICE_CONTROL_STOP it posts a message in the message queue, then later that message is retrieved and the OnStop() handler is invoked. The handler cleans up stuff and calls CoUnitialize() . Most of the time it works allright, but once in a while the latter call hangs. I can't