windows-services

MSI Uninstall issue: Error 1001 -> The saved State dictionary contains inconsistent data and might have been corrupted

元气小坏坏 提交于 2019-12-01 08:05:55
I need to create a few Windows Services and obviously I would like to package them in a nice installer. Since I was unfamiliar with Service creation/installation I basically used code from the following example: Advanced Service Installation I did not change ProjectInstaller or InstallActions and basically just plugged my own services (File monitoring/conversion). Building and compiling the code works A-OK: The Installer works, the services are installed (but NOT started as might be expected) My Services themselves all work The Uninstall FAILS, stating the error from the title What is very

how to map network drive for Clearcase View in Windows service?

不问归期 提交于 2019-12-01 08:03:11
问题 I want to map a clearcase view on network drive inside a windows service. I have tried with net use command, but it did not work properly. 回答1: You should be able to run the same kind of command than the one used when paths are too long, which is subst : subst X: c:\path\to\my\View # for snapshot view subst X: M:\myView # for dynamic view in order to map a view to a drive letter. This should work from within a service, provided: you are using your Windows account (and not the "Local System

Check Windows services status - what privilege do I need

北城以北 提交于 2019-12-01 07:47:21
问题 I want to check some Windows services status on different remote servers like this: ServiceController sc = new ServiceController("MyWindowsService", "COMPUTER_NAME"); var status = sc.Status But I don't (and can't) have Administrator privileges on those servers. What right should I be asking for to check the status ? I don't wanna be able to restart them either, I need Read access only, The application isn't running on the same machine. 回答1: Non-admin users can connect to the Service Control

Specify directory for Serilog rolling file path

非 Y 不嫁゛ 提交于 2019-12-01 07:36:51
Consider this app.config appSetting entry: <add key="serilog:write-to:RollingFile.pathFormat" value="ServerServiceApp-{Date}.log" /> This is done at app startup: Log.Logger = new LoggerConfiguration() .ReadFrom.AppSettings() .Enrich.WithThreadId() .CreateLogger(); This is in a Windows service app. The log file ends up here: C:\Windows\SysWOW64 Clearly, we’d rather have the log file end up in the same directory that houses this service’s .exe (customers don’t want us writing stuff to SysWOW64). But how? We need the ReadFrom.AppSettings in there so that the customer can supply serilog settings

MSI Uninstall issue: Error 1001 -> The saved State dictionary contains inconsistent data and might have been corrupted

匆匆过客 提交于 2019-12-01 07:09:34
问题 I need to create a few Windows Services and obviously I would like to package them in a nice installer. Since I was unfamiliar with Service creation/installation I basically used code from the following example: Advanced Service Installation I did not change ProjectInstaller or InstallActions and basically just plugged my own services (File monitoring/conversion). Building and compiling the code works A-OK: The Installer works, the services are installed (but NOT started as might be expected)

Start/Stop service from an ASP . NET page

谁都会走 提交于 2019-12-01 06:44:39
I implemented a web page (ASP .NET, VB) to start/stop a Windows service. I used impersonification, as described here: http://support.microsoft.com/kb/306158 Everything it's ok when the page reads the service's status: _domain = Me.TextBoxDomain.Text _user = Me.TextBoxUserName.Text _password = Me.TextBoxPassword.Text _s = New ServiceController(Constant.ServiceName) If impersonateValidUser(_user, _domain, _password) Then Me.LabelServerStatusValue.Text = _s.Status.ToString undoImpersonation() Else 'Error End If The problem occurs when the page tries to start (or stop) the service: _domain = Me

System.Diagnostics.Process.Start() cannot start process when called from Windows service

安稳与你 提交于 2019-12-01 06:29:10
I am trying to start an external process from a .NET Windows service. In the past I have used the Process.Start() overload that takes the executable path and a command line string. This works. But now I would like to start the process and have it run in the context of a particular user. So I call this version of Start() public static Process Start( string fileName, string userName, SecureString password, string domain) However, when I call the method, the application I am trying to run generates an unhandled exception: The application failed to initialize properly (0xc0000142). Click on OK to

Running delayed_job as a windows service

佐手、 提交于 2019-12-01 06:02:39
I am trying to get delayed_job working as a windows service. I am so thoroughly sick of windows I can't even begin to put it into words, but I am stuck with it for now due to 3rd party dependencies. Running rake jobs:work starts the worker in a console with no problems. I've created an empty windows service to start and shutdown the worker using sc create DelayedJobWorker... . However, I can't get the service to start and stop the worker. I'm not sure what the best approach is - what I should be parameterising the service with / asking it to call. Any suggestions gratefully appreciated.

Plink from Windows service cannot find Pageant

末鹿安然 提交于 2019-12-01 05:43:36
问题 I have one windows service which will use plink.exe for SSH connection and I found that Plink cannot find the running Pageant. Here is the steps I have done so far. Install Windows service to run as particular user Before starting Windows service, I log in as that user and start Pageant with PuTTY generated key. Then I start the Windows service (but I can't manage to make it work since Plink cannot find Pageant and server reply as No supported authentication methods available .) Note: If I

Start/Stop service from an ASP . NET page

狂风中的少年 提交于 2019-12-01 05:29:23
问题 I implemented a web page (ASP .NET, VB) to start/stop a Windows service. I used impersonification, as described here: http://support.microsoft.com/kb/306158 Everything it's ok when the page reads the service's status: _domain = Me.TextBoxDomain.Text _user = Me.TextBoxUserName.Text _password = Me.TextBoxPassword.Text _s = New ServiceController(Constant.ServiceName) If impersonateValidUser(_user, _domain, _password) Then Me.LabelServerStatusValue.Text = _s.Status.ToString undoImpersonation()