windows-services

Installing a win32 service using MSBuild and Microsoft.Sdc.Tasks

↘锁芯ラ 提交于 2019-12-06 03:41:41
问题 I'm trying to install windows service using the Microsoft.Sdc.Tasks library. <ControlService Action="Install" ServiceName="Service1" User="XXX Password="XXX" ServiceExePath="$(DeployFolder)\XXX.exe"/> But I keep getting prompted for the user and password! This will not work as I'd like to have it as an automated build on the build server. I mean, the user and password that I want to run the service under are in the actual target. How do I get it to install the service using the configured

How do you debug a windows service that is being installed?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 03:21:42
I know how to attach a debugger to a windows service, but I can't seem to get attached to one that's being installed and started by a windows installer. I've tried: Setting a Thread.Sleep(TimeSpan.FromSeconds(30)); at the beginning of the on-start, but when I try to attach in Visual Studio, the name of the service does not appear as an option. This normally works, the service's name shows up in the list, but when using the installer it does not. Setting a Debugger.Break and Debugger.Launch. Neither really do anything. What can I do to debug my service? Update: I added a Thread.Sleep for 30

running UI with windows service

岁酱吖の 提交于 2019-12-06 02:44:11
i am planning to run a launch/monitor a UI application using a windows service(written in C#).with "Allow service to interact with desktop " checked. this works fine with windows xp, but with windows 7 a pop is shown as below and when i click on view the message , then the whole screen blanks out,with only UI showing up ,as shown below. is there any way to make it work without the message being shown and screen going blank. comments/suggestions appreciated. Regards DEE Meligy "Allow service to interact with desktop " is a legacy option that is now highly discouraged, and although it exists, is

How do I get the ports opened by a Windows Service?

时间秒杀一切 提交于 2019-12-06 02:27:55
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 7 years ago . I want to get the list of window services and their ports in C#. I'm able to get all window services by using ServiceController but I'm unable to get ports of these services. 回答1: Please check this question on stackoverlow. It is not exactly the same as you are asking, but it points to a useful function called GetExtendedTcpTable available through PInvoke,

Displaying Message Box using .NET Windows Services In Windows 7

99封情书 提交于 2019-12-06 02:22:46
Displaying Message Box using .NET Windows Services In Windows 7 We had a windows service that was used to display a confirmation message box once a user scanned their access card on windows xp but once we migrated to windows 7, that pop up functionality no longer works. As described in this post Displaying Message Box using .NET Windows Services In Windows 7 , i have followed the instruction and it works when i run the application as console application but when i install it as a windows service it does not work. below is my code. Also the result variable is returning false and the err

SQL “login failed for user [username]” error for windows service, but SSMS login works

只愿长相守 提交于 2019-12-06 02:07:53
问题 I'm writing a windows service that needs to connect to a SQL server to retrieve some information. However, the server doesn't allow me to connect: login failed for user [domain/username] . The strange part is that everything works totally fine from inside SSMS. I can log in, query the database, and everything works out perfectly. It's only through the windows service that it's throwing that error. For reference, here's the connection string I'm using: Data Source=sqlserveraddresshere;Initial

assign each thread a cpu core

怎甘沉沦 提交于 2019-12-06 01:48:07
问题 i have a windows service written in .net 4 which doing jobs periodically using Threads. the server has more than 20 cpu core. i create 10 threads in my windows service. is it possible to assign each thread a cpu core? 回答1: The OS already does precisely that for you. It doesn't guarantee that each thread will stay on the same core forever (and in nearly all cases, there's no need for that either), but it does try to keep as many cores busy as possible. Which means giving all available threads

How to configure Jboss 7 (v7.1.0) to run as a windows service [closed]

回眸只為那壹抹淺笑 提交于 2019-12-06 01:45:54
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I need to run Jboss 7.1.0 as a windows service. I have seen some instructions from google but most seem to be for earlier versions of

Why won't my Windows Service that is hosting a WCF Service run under LocalService or NetworkService accounts

◇◆丶佛笑我妖孽 提交于 2019-12-06 01:37:09
问题 I have a simple Windows Service hosting a WCF Service. I want to run the Windows Service under the LocalService account (or even the NetworkService account). However when I try to start it under either of these accounts it starts then immediately stops. It starts and runs OK under the LocalSystem account. Any thoughts as to how to work out why it will not stay running under LocalService or NetworkService. Thanks, David 回答1: Thanks to the suggestions to check the event log from marc_s and ho1

Windows service cannot see named semaphore

旧城冷巷雨未停 提交于 2019-12-06 00:39:16
问题 I'm trying to mediate a small windows service, making it to wait for a signal from another process during startup. For sure I know that such approach may (or even will) sometimes lead to service startup timeout. That's not the case. The problem is with named System.Thread.Sempaphore I use for mediation purposes. Semaphore is created and acquired somewhere else using following construct. There's no change GC has it as I explicitly break the execution right below given line for test purposes.