windows-services

Multiple Windows Services in One exe

妖精的绣舞 提交于 2019-11-27 00:17:41
问题 I am trying to build several Windows services to do different things. For instance, I need Windows services that will: Send a daily report via email Periodically cleanup some archived info every 30 minutes etc. The tasks I need the windows services to do are distinct so I don't really like the idea of having them all in one service. What I've got so far is a project in Visual Studio 2008. I've created a windows service, I've set up a timer on the OnStart event (it just writes to a text file

Windows service on Local Computer started and then stopped error

痞子三分冷 提交于 2019-11-27 00:07:40
问题 Usually, I get this error: (The "service name" service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other service or programs) when there's something wrong with my code, like non-existing drive paths, etc. The windows service will not start. I have a windows service that backs up folder/files, to a location if it reached the size limit. Details are all provide by an XML Configuration that the windows service reads on start. I have a

System.BadImageFormatException: Could not load file or assembly (from installutil.exe)

穿精又带淫゛_ 提交于 2019-11-27 00:04:04
I am trying to install a Windows service using InstallUtil.exe and am getting the error message System.BadImageFormatException: Could not load file or assembly ' {xxx.exe} ' or one of its dependencies. An attempt was made to load a program with an incorrect format. What gives? EDIT: (Not by OP) Full message extracted from dup getting way more hits [for googleability]: C:\Windows\Microsoft.NET\Framework64\v4.0.30319>InstallUtil.exe C:\xxx.exe Microsoft (R) .NET Framework Installation utility Version 4.0.30319.1 Copyright (c) Microsoft Corporation. All rights reserved. Exception occurred while

How to install and start a Windows Service using WiX

只谈情不闲聊 提交于 2019-11-27 00:03:11
问题 I tried to use the codes below in Wix. But when installing, the installer was freezing for like 3 minutes on status: Starting services, then I got this message "Service Jobservice failed to start. Verify that you have sufficient privileges to start system services". Is there any wrong in my codes? And can I ask the user to input the windows system user name and password during the installation to get the "privileges"? Thanks a lot! <File Id='JobServiceEXE' Name='JobService.exe' DiskId='1'

(SC) DeleteService FAILED 1072

我只是一个虾纸丫 提交于 2019-11-27 00:01:28
问题 Last time I create WAS profile and WASService then I try to config and run many script for learn how to config WAS, Finally it crash so i use wasprofile delete this profile and forgot delete WASService. Now I found IBM Webphere Application Server service display in services.msc list, so I tried to delete it with WASService.exe -remove command and windows SC command but I got message C:\Program Files\IBM\WebSphere\AppServer\bin>sc delete "IBMWAS61Service - DEV" [SC] DeleteService FAILED 1072:

Hosting ASP.NET Core as Windows service

烈酒焚心 提交于 2019-11-26 23:57:45
问题 As I get it in RC2 there's a support for hosting applications within Windows Services. I tried to test it on a simple web api project (using .NET Framework 4.6.1). Here's my Program.cs code: using System; using System.IO; using System.Linq; using System.ServiceProcess; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting.WindowsServices; namespace WebApplication4 { public class Program : ServiceBase { public static void Main(string[] args) { if (args.Contains("--windows

Create Windows Session programmatically from Console or Windows Service

戏子无情 提交于 2019-11-26 23:35:18
问题 How can I programmatically log in to windows to create a Windows Logon Session? I need a way that works from a WinForms app, from a Console app, and (most important) from a Windows Service. One other requirement is that I need it to work on a the local system that the program/service is running on and also for remote systems. If there's a way to do this using pInvoke/Win32 API I am open to that too. I found these similar questions/answers in my research: Programmatically create and launch and

Communicate with WCF Windows Service in VB6?

巧了我就是萌 提交于 2019-11-26 23:23:50
问题 I have a VB6 application that I want to communicate with a WCF Windows Service that I have written which imports Security Certificates. The only function in the service takes two string arguments. I have been having a lot of difficulty getting the two programs to communicate however. In VB.NET, it is easy, just make a reference to the service as you would a web service. In VB6, however, it is not so simple it seems. Searching only seems to pull up examples of how to WRITE a Windows service in

Querying Windows file indexing service using C#

℡╲_俬逩灬. 提交于 2019-11-26 23:17:56
问题 Is it possible to query file indexing service using C#? Does file indexing service expose a database? If so what is the scheme of this database? 回答1: The thing is now called 'Windows Search'. Current version is 4.0. A special SDK exists and documentation is readily available in MSDN So the answer is positive: yes, it it possible. Here's the page with more info. 来源: https://stackoverflow.com/questions/4131420/querying-windows-file-indexing-service-using-c-sharp

ClickOnce deploy a Windows Service?

心已入冬 提交于 2019-11-26 22:53:10
问题 Is it possible to deploy a Windows Service using ClickOnce? If so, how do you achieve this? Currently we have to use a Deployment project, and the installation process could be simplified greatly by using ClickOnce. 回答1: AFAIK you can't really use ClickOnce end-to-end to deploy a service; there are issues with both the file locations (ClickOnce installs into a user's profile) and installation (ClickOnce is largely side-effect free). You can, however, write a service as an exe that can self