topshelf

Topshelf window service giving Error 1053 when try to start the service

﹥>﹥吖頭↗ 提交于 2019-12-20 01:01:09
问题 I have developed a windows service using Topshelf. it works fine locally. When i deployed to test and try to start the service, it is giving me the following error: Error 1053: The service did not respond to the start or control request in a timely fashion. The test server is running on Windows server 2012. This is my service start and stop methods: public void Start() { _logProvider.Info("Service started."); StartScheduledJobs(); } public void Stop() { _scheduler.Shutdown(true); _logProvider

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 can I automate a Topshelf interactive service install?

江枫思渺然 提交于 2019-12-13 12:19:42
问题 I have a couple Topshelf services that run under a specific service account. If I install the services manually from a command line, I can use the --interactive flag, and a dialog box comes up allowing me to enter the username and password. I'd like to be able to automate this through a Powershell script. Does anyone know how to do this? (Not concerned about Powershell specifically, but with how can I provide the username and password in any installation script.) As Travis mentioned, I took a

Windows service - Login failed for user 'NT AUTHORITY\SYSTEM'

不问归期 提交于 2019-12-11 14:56:44
问题 I've created simple console log app which behaves a windows service. I'm wondering why am I getting an error Login failed for user 'NT AUTHORITY\SYSTEM' if I change my connection string in a way to use some another user which I previously created on SQL Server. Example of connection string: <value>Data Source=DESKTOP-Z67;Initial Catalog=MyDb;Integrated Security=false;User ID=service;Password=test1234</value> Event if I specified this connection string, I'm getting error Login failed for user

How to launch a Winforms app from a windows-service

回眸只為那壹抹淺笑 提交于 2019-12-11 14:50:08
问题 Hello i am trying to launch an interactive process - a winforms app - from a windows service on the current session. I do not know how to do that.I am using TopShelf and i tried launching the process using the WhenSessionChanged hook provided by TopShelf . I can get the sessionId var exitCode = HostFactory.Run(x => { x.Service<MyService>(s => { s.ConstructUsing((h) => new MyService()); s.WhenStarted(t => t.Run()); s.WhenStopped(t => t.Stop()); s.WhenSessionChanged((anubis, args) => { string

TopShelf- difference between ConfigureServiceInIsolation and ConfigureService

試著忘記壹切 提交于 2019-12-11 10:47:13
问题 Can someone help me understand this topshelf project...mainly the difference between ConfigureServiceinIsolation and ConfigureService. http://topshelf-project.com/documentation/getting-started/ It would be nice if someone could point me to some proper documentation about it. Thanks 回答1: ConfigureServiceInIsolation will run your service in a separate AppDomain within the same process. If you are only running one service, just use ConfigureService. There is a pretty good example on the link you

Working with TopShelf, I'm running into an error around “Topshelf.HostConfigurators.WindowsServiceDescription service has not been installed yet.”

ⅰ亾dé卋堺 提交于 2019-12-11 07:43:26
问题 Has anyone had experience with TopShelf when building Windows Services? I keep running into this error when trying to start the service, "Topshelf.HostConfigurators.WindowsServiceDescription service has not been installed yet." The build, installer, installation, and all those steps are completed and the service appears in the services list in Windows Server, yet when I click on the service and attempt to start it, this exception is thrown. The full error message is shown below. INFO 10:23:08

Topshelf hosting application debugging in VS2010

孤人 提交于 2019-12-10 20:04:17
问题 I'm trying to use the Topshelf hosting application Topshelf.Host.exe to execute my .NET Class Library as a Windows service. http://topshelf-project.com/documentation/shelving/ I'm having trouble hooking up the debugger inside VS2010. Here's what I have setup Topshelf.Host.exe at say c:\projects my classlibrary service building to c:\projects\Services\library-name\ running Topshelf.Host.exe as the class library's external application to debug with With F5/run Topshelf.Host.exe is running, but

Ninject scope problems with TopShelf, Ninject and EF code first

岁酱吖の 提交于 2019-12-10 14:44:46
问题 I am currently using TopShelf with Ninject to create a Windows Service. I have the following code to setup the Windows Service using TopShelf: static void Main(string[] args) { using (IKernel kernel = new StandardKernel(new NinjectDependencyResolver())) { Settings settings = kernel.Get<Settings>(); var host = HostFactory.New(x => { x.Service<BotService>(s => { s.ConstructUsing(name => new BotService(settings.Service.TimeInterval)); s.WhenStarted(ms => ms.Start()); s.WhenStopped(ms => ms.Stop(

Single command line parameter to control Topshelf windows service

点点圈 提交于 2019-12-10 13:54:56
问题 I've made a topshelf windows service that starts three tasks. But since it might happen that one of those task might crash (yes, I know about EnableServiceRecovery ), it would be better to use one program to create 3 services with different names and install them using command line parameters. So in theory the code would look like: static void Main(string[] args) { // *********************Below is a TopShelf code*****************************// HostFactory.Run(hostConfigurator => {