windows-services

Manage remote service using alternate credentials

穿精又带淫゛_ 提交于 2019-12-04 05:15:46
问题 -- Original Post -- I am trying to manage (start/stop) a windows service on a remote machine using alternate credentials. I know that I can use the ServiceController class to manage a service using my current credentials: Dim sc As New ServiceController(ServiceName, ComputerName) but I want to use different credentials. The other classes I am using (DirectoryEntry and System.Management) both support using alternate credentials... Help would be greatly appreciated. -- Working Code (built based

Running a C# console application as a Windows service

旧巷老猫 提交于 2019-12-04 04:45:32
I have a basic C# console application that I would like to run as a Windows Service. I have created the Windows service using sc create . This worked fine, and I can see my service under services.msc . When I try and start this service I get the following error: Could not start the PROJECT service on Local Computer. Error 1053: The service did not respond to the start or control request in a timely fashion.` I read that this might be due to the service code taking longer than 30000 ms to execute. Therefore I removed the bulk of the code so that hardly anything is being executed.. yet the same

Create a .NET Windows Service on Windows Mobile 6.x

痴心易碎 提交于 2019-12-04 04:42:50
问题 I would like to create a windows service in .NET that runs on WinMo 6.x.... There r a lot of documentation for how to do that in MFC (and non-MFC) http://msdn.microsoft.com/en-us/library/ms838599.aspx but I can't find any pointers for .NET stuff, is it even doable? Thanks, 回答1: I'm pretty sure (not 100%) you can only create a native service DLL (which means no .Net for this). A workaround is to create a console app (or a regular app that does everything from its Main method) and drop it in

Is it good to have windows service or console application?

徘徊边缘 提交于 2019-12-04 04:38:27
I have a tasks table in my db. I want to read data from this table and run tasks. Which one is better whether to have it as windows service or a console application running. The server on which this will be run will not be shutdown Dave New You most likely want to use a windows service. Benefits: You can control the user (and the rights associated with this user account) which starts the process An automatically started process means the desktop need to be on, not user logged, for the service to run A policy on failure can be defined (try to restart n times run a specific program if fails) A

How do Windows services behave when entering/waking up from sleep or hibernate modes?

佐手、 提交于 2019-12-04 04:24:44
I have a service written in C# that does not seem to come down cleanly when the computer enters sleep mode. The user needs to manually stop and restart the service to retain functionality. I know what the issue is but I am not sure where to fix it. How do Windows services behave when going into/come out of sleep and hibernate? How do services react to power events? Really, it depends . In your service you can handle the hibernate/suspend/etc events by handling it in your service protected override bool OnPowerEvent(PowerBroadcastStatus powerStatus) { //do stuff here } 来源: https://stackoverflow

Host Web API as Windows Service using OWIN

不羁的心 提交于 2019-12-04 03:52:19
I'm trying to run a Web API application as a Windows Service using OWIN. However, I get the following message, when trying to start the service: The [ServiceName] service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs. For some reason my service doesn't understand that it should keep listening to http://localhost:9000 The VS solution consists of two projects: The Web API and the Windows service. In the Windows service project I have: static class Program { static void Main() { ServiceBase[] ServicesToRun;

How does one stop a Windows service to do an upgrade install?

徘徊边缘 提交于 2019-12-04 03:45:32
问题 I have developed a Windows service along with a setup project using Visual Studio 2008. When I do an upgrade install I get the following warning: The following applications are using files which the installer must update. You can either close the applications and click "Try Again", or click "Continue" so that the installer continues the installation, and replaces these files when your system restarts. I would like to stop the Windows service during the upgrade install. I have tried creating a

Configuring Microsoft Application Insights to monitor a windows service

主宰稳场 提交于 2019-12-04 03:22:19
Is it possible to configure Microsoft's Application Insights to monitor a Windows service? I have a VM running in Azure on which the web service is hosted. Which version of the monitoring agent to I need to install and what steps need to be undertaken in order to allow monitoring data do be seen in the dashboard? I'd also love to see this capability, but it seems from this MSDN page that it's not possible. I hope they expand the service's capabilities later on as it would be great to see a product on the level of AppDynamics or New Relic from MS. Performance and exception monitoring with

Sql Exception: No Process Is on the Other End of the Pipe

谁说我不能喝 提交于 2019-12-04 03:20:15
I can not access my sql server connection from c# code. I get this error: Sql Exception: No Process Is on the Other End of the Pipe thats the connection string in my app.config: <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=BELLA\SQLEXPRESS;Initial Catalog=TLP;User Id=pascal;Password=test;Pooling=False"/> When I use windows authentication: Integrated Security=True; Then I can connect to the database. BUT I can NOT use windows authentication because the opening of the sql connection is done from within a windows service which is run as

windows could not start service on local computer error 5 access is denied

你。 提交于 2019-12-04 03:15:35
After debugging and installing windows service in windows 8 I have error when I try to start a windows service :"The Windows could not start service on local computer Error 5 Access is denied" .While attempting fist answer from this link i found that NETWORK SERVICE account doesn't exist in the list of user names for assigning the correct permissions in windows 8 .How i can solve this problem using windows 8? JD - DC TECH Right click in the service in Window Services and go to Properties . Then go to Log On tab and select Local System account . Click on Ok button and start the service. I got