windows-services

Easiest way to develop/debug a Windows service

别来无恙 提交于 2019-12-03 08:41:53
I'm developing a Windows Service in VB.NET 2008, but I feel like I'm going to have an aneurysm. To debug the service, I've added a 15 second wait to the initialization code, which gives me time to start the service and attach the .NET debugger before anything happens, so I can hit breakpoints and such. I really miss "integrated" debugging with this type of workaround, and testing seems to be a huge pain. What's the best way to do "regular" debugging of a Windows Service that's in development? One option I'd considered was moving all of my logic to a DLL project, leaving only control logic in

Send string commands or bytes to a Windows Service? (When running)

谁说我不能喝 提交于 2019-12-03 08:23:59
Is there any way to give string or byte array commands to a Windows Service? (When running) I will sometimes host a WCF service within a Windows service for the purpose of controlling the behavior of the service at runtime. If you really just want to send raw data to the service and you don't want to deal with configuring a WCF service (which really isn't that difficult to do, by the way), you could probably accomplish that using Named Pipes or by listening for socket connections on some port. You need some form of IPC (Inter-Process Communication). Which one you choose can depend greatly upon

MSDeploy to install windows service?

血红的双手。 提交于 2019-12-03 08:22:34
问题 We have a website which publishes events using NServiceBus. The site is deployed using msdeploy. We also have the NServiceBus.exe which should run as a windows service to subscribe to these events, and we'd like to deploy that as well. Is there any way to package the service as well as the website, so that it can be installed as well? Is it possible to package separately so we can deploy it to another server? Any tips on where to find information on how to do this would be great, as we can do

Communication between Windows Service and Desktop Application

妖精的绣舞 提交于 2019-12-03 08:04:26
问题 I know that similar questions have been asked before, but even after all my Googling I'm still completely lost. I've written a small Windows Service that does what my main application used to do in a background thread (it made sense to move it to a separate service for several reasons). When the background thread was running as a part of my application it would fire an event every time it finished working (updating a database, in this case) and I would use a timestamp from that event to grab

Windows Service Choose User or System Account on Install

夙愿已清 提交于 2019-12-03 07:58:30
问题 When installing a windows service, is there a way to let the user installing choose between a specific user account and a computer account, such as LocalSystem? I see how to do this at build time through service installer properties, but not during install. 回答1: @Doobi, @Eric, in my experience (Win7Home 64-bit, VS2010Express, not on a domain) processInstaller.Account = ServiceAccount.LocalService; processInstaller.Username = null; processInstaller.Password = null; will install the service as

Service does not start

半腔热情 提交于 2019-12-03 07:45:31
I created a Windows service with Delphi and used two method to install, start and stop. Method 1 if i install this service using commandline C:\MyService\ServiceApp.exe /Install it installed successfully and i can start and stop too in the service console. Method 2 but if i install the same service with different name using sc e.g. C:\Windows\system32>sc create myservice binpath= c:\MyService\ServiceApp.exe I see it is installed but i can not start the service using service console as well as with sc start myservice when i do query using SC , result are as follows C:\Windows\system32>sc query

Node js start and stop windows services

那年仲夏 提交于 2019-12-03 07:30:24
问题 I have a nodeJS app that communicates with a third party application installed as a windows service. My nodeJS application requires this service to be running, however if some circumstances it may not. Im trying to search for a method to check if this windows service is running and if not start it. After many days searching i have found many results for running a nodeJS application as a windows service but not one providing the ability to start/stop already installed windows services. Is this

unhandled exception will make WCF service crash?

為{幸葍}努か 提交于 2019-12-03 07:29:59
I want to know whether unhandled exception will make WCF service crash. I have written the following program which shows unhandled exception in a thread started by WCF service will make the whole WCF service crash. My question is, I want to confirm whether unhandled exception in threads (started by WCF service) will make WCF crash? My confusion is I think WCF should be stable service which should not crash because of unhandled exception. I am using VSTS 2008 + C# + .Net 3.5 to develop a self-hosted Windows Service based WCF service. Here are the related parts of code, namespace Foo { // NOTE:

Create a combo command line / Windows service app

冷暖自知 提交于 2019-12-03 07:24:45
问题 What's the best way in C# to set up a utility app that can be run from the command line and produce some output (or write to a file), but that could be run as a Windows service as well to do its job in the background (e.g. monitoring a directory, or whatever). I would like to write the code once and be able to either call it interactively from PowerShell or some other CLI, but at the same time also find a way to install the same EXE file as a Windows service and have it run unattended. Can I

Credentials when Installing Windows Service

给你一囗甜甜゛ 提交于 2019-12-03 07:22:26
问题 I am attempting to install a C# windows service project using a VisualStudio.Net deployment project. To run the deployment project I right-click and select "install" from the context menu, the install wizard runs and eventually prompts me with a "Set Service Login" dialog which asks for username & password. When I install a service using the sc utility from the command line, I don't have to provide credentials. Do I have to create a login just for this service? I'd prefer to use "Local System