windows-services

Windows Service launching and Exe

拜拜、爱过 提交于 2019-12-10 16:27:34
问题 I am currently working on a project that contains a WCF service, a Windows service and a WPF application. The Windows service communicates with the WCF, and under a certain circumstance, must launch the WPF application for the user to receive messages. (WCF is on a remote server, the rest is on the client). I've hit a bit of a snag with the launch. I have the services writing messages to the application logs so that I can somewhat 'debug' along the way. The Windows service runs the following

How to pass a message from windows service to windows desktop application using c#?

我只是一个虾纸丫 提交于 2019-12-10 16:25:51
问题 I want to pass a message from windows service to an windows desktop application that is already running. I have implemented a timer on windows service. after an interval the service send a message to the windows application. The service or sender code is below: System.Diagnostics.Process[] lProcs = System.Diagnostics.Process.GetProcessesByName("TestProcess2"); if (lProcs.Length > 0) { IntPtr handle = lProcs[0].MainWindowHandle; if (handle != IntPtr.Zero) SendMessage(handle, 232, IntPtr.Zero,

WiX service installer and custom install events

守給你的承諾、 提交于 2019-12-10 15:40:04
问题 I have an existing (C# based) windows service that is derived from the Installer class and I currently use the MS supplied, command line InstallUtil to install it and uninstall it. This works fine and as part of my system I have attached event handlers to the AfterUninstallEventHandler and CommittedEventHandler events. In my case I simply use them to log messages to a custom event log - showing the install and uninstall dates and times and program versions. At the moment I am experimenting

How to install application as windows service using NSIS script

一世执手 提交于 2019-12-10 15:33:34
问题 How to install application as windows service using NSIS script? I used this command in the script Exec '"sc.exe" but after installation i couldn't find any service in windows services related to it so help me thanks. 回答1: Maybe that the NSIS Simple Service plugin can help you. The syntax is as simple as SimpleSC::InstallService "MyService" "My Service Display Name" "16" "2" "C:\MyPath\MyService.exe" "" "" "" Pop $0 ; returns an errorcode (<>0) otherwise success (0) Here the example install

Create a Service using C#

試著忘記壹切 提交于 2019-12-10 15:18:04
问题 I need to create a service using C# and sc.exe utility when i try to execute C:\Windows\system32\sc.exe create ServiceName binPath= D:\work\ServiceExe.exe , it works fine. But when i try to execute Process.Start(@"C:\Windows\system32\sc.exe create ServiceName binPath= D:\work\ServiceExe.exe"); I have an exception, that the system cannot find the file specified . What can it be? File exists, Service removing before re-install. 回答1: You should use another overload of Process.Start which takes

How to choose value for serviceStatus.dwWaitHint?

五迷三道 提交于 2019-12-10 14:56:03
问题 I am following this tutorial: http://msdn.microsoft.com/en-us/library/zt39148a(v=vs.110).aspx to create a windows service. I have a class called TaskManager which uses Quartz.Net to manage a bunch of jobs. It has .Go() (which doesn't block) and .Stop() methods. If I've understood correctly, all I need to do in my service is private TaskManager _taskManager; public DataPumpService() { InitializeComponent(); _taskManager = new TaskManager(); } protected override void OnStart(string[] args) {

No endpoint listening at net.pipe

这一生的挚爱 提交于 2019-12-10 14:55:26
问题 I am getting the following error: There was no endpoint listening at net.pipe://localhost/ServiceModelSamples/service that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. I am calling WCF self hosted service inside windows service from another WCF call as follows. _host = new ServiceHost(typeof(CalculatorService), new Uri[] { new Uri("net.pipe://localhost/PINSenderService") }); _host.AddServiceEndpoint

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(

Get Desktop Size from Windows Service?

廉价感情. 提交于 2019-12-10 14:08:15
问题 I'm trying to get the size of the Windows' desktop (the whole thing, not just a single screen) from inside a service that I've written. In WinForms -- the standard C# method of: SystemInformation.VirtualScreen.Width SystemInformation.VirtualScreen.Height seems to work (if you import the Winforms DLL, which I want to avoid) -- but it returns the wrong value. The desktop size is 2048x768 (2 screens), but the service reports 1024x768 (presumably it only picks up on one of the screens.) Checking

Cannot download microsoft symbols when running cdb in a windows service

可紊 提交于 2019-12-10 13:07:40
问题 I have a .NET windows service that is calling cdb.exe to analyze crash dumps. I want to download the symbols from http://msdl.microsoft.com automatically when needed, using the argument: -y srv*c:\symbols*http://msdl.microsoft.com/download/symbols If I run the application as a console application, It works as expected and it downloads the needed symbols for each dump. The problem is when I start the app as a windows service, the symbols are not downloaded and, if I turn symnoisy on, at cdb's