windows-services

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

允我心安 提交于 2019-12-09 07:17:49
问题 Is there any way to give string or byte array commands to a Windows Service? (When running) 回答1: 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

How to make HTTP request in windows service? [closed]

自古美人都是妖i 提交于 2019-12-09 06:54:14
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . i want to implement my first windows service application. this app must run day and night. it should to send each 1 hour http request with possibility to make snapshot of requested webpage and save it in database

unhandled exception will make WCF service crash?

假如想象 提交于 2019-12-09 05:59:51
问题 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

How to debug the potential memory leak?

倖福魔咒の 提交于 2019-12-09 00:54:45
问题 I programed the windows service to do a routine work. I InstallUtil it to windows service and it'will wake up and do something and then thread.sleep(5min) The code is simple, but I've noticed a potential memory leak. I traced it using DOS tasklist and drew a chart: Can I say that it's pretty clear there was memory leak, although so little. My code is like below, Please help me to find the potential leak. Thanks. public partial class AutoReport : ServiceBase { int Time = Convert.ToInt32

Failed to install and start Windows services in WiX installer

元气小坏坏 提交于 2019-12-08 23:37:38
问题 I am creating an MSI package for installing and starting Windows services using WiX v3.8. The code as follows: <Component Id="INSTALLAPSSERVICE" Guid="991D5F82-0E77-4FE3-B1D8-4C941B84C7CD" Win64="yes"> <File Id="ApsService.exe" Name="ApsService.exe" Source="Resource\ApsService.exe" KeyPath="yes" Vital="yes" DiskId="1"></File> <ServiceInstall Id="ApsServiceInstaller" Name="ApsService" DisplayName="ApsService" Type="ownProcess" Start="auto" ErrorControl="normal" Description="A monitor service

How to create a Windows Service in Powershell for “Network Service” account?

坚强是说给别人听的谎言 提交于 2019-12-08 23:01:32
问题 I want to create a Windows Service using Powershell. Creating it for a given user is piece of cake. I used this function adapted from here. function ReinstallService1 ($serviceName, $binaryPath, $login, $pass) { Write-Host "installing service" # creating credentials which can be used to run my windows service $secpasswd = ConvertTo-SecureString $pass -AsPlainText -Force $mycreds = New-Object System.Management.Automation.PSCredential ($login, $secpasswd) # creating widnows service using all

Running ffmpeg.exe through windows service fails to complete while dealing with large files

夙愿已清 提交于 2019-12-08 16:45:37
I am using ffmpeg.exe to convert video files to flv format . For that purpose i use a windows service to run the conversion process in background . While trying to convert large files (i experienced it when the file size is >14MB) through windows service it gets stuck at the line which starts the process (ie, process.start(); ). But when i tried to execute ffmpeg.exe directly from command prompt it worked with out any problems. My code in windows service is as follows: private Thread WorkerThread; protected override void OnStart(string[] args) { WorkerThread = new Thread(new ThreadStart

scheduled task or windows service

北慕城南 提交于 2019-12-08 15:45:11
问题 My team is having a debate which is better: a windows service or scheduled tasks. We have a server dedicated to running jobs and currently they are all scheduled tasks. Some jobs take files, rename them and place them in other directories on the network. Other jobs extract data from SQL, modify it, and ship it elsewhere. Other jobs ftp files out. There is a lot of variety, but all in all, they are fairly straightforward. I am partial to having each of these run as a windows service instead of

Windows Service Error: Installog access is Denied

こ雲淡風輕ζ 提交于 2019-12-08 15:41:13
问题 I get following error while installing my Windows service through Command prompt Access to the path 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.In stallLog' is denied. I am using following command: C:\Windows\Microsoft.NET\Framework\v2.0.50727>installutil.exe "C:\Hive-WindowsService\HiveBatchProcess\HiveBatchProcess\bin\Debug\HiveBatchProcess.exe" -i What could be wrong? 回答1: do you have administrator rights ? Try to run the service setup by launching the command prompt as

How do I find the install directory of a Windows Service, using C#?

China☆狼群 提交于 2019-12-08 14:37:58
问题 I'm pretty sure that a Windows service gets C:\winnt (or similar) as its working directory when installed using InstallUtil.exe. Is there any way I can access, or otherwise capture (at install time), the directory from which the service was originally installed? At the moment I'm manually entering that into the app.exe.config file, but that's horribly manual and feels like a hack. Is there a programmatic way, either at run time or install time, to determine where the service was installed