Questions tagged [windows-services]
Windows services are background service processes run by the Service Control Manager on Windows NT based operating systems, similar to daemons or UNIX services.
8,760
questions
0
votes
0
answers
13
views
Windows service not processing requests
We have a windows service which has been installed in multiple client machine and working perfectly fine from past few years.
But from few days we have observed that the service is not processing any ...
0
votes
0
answers
12
views
How to get Windows services and their PID if they're running in C#
I am trying to create a simple app that can kill / restart or even start a Windows service based on its name.
C:\Users\user>tasklist
Image Name PID Session Name Session# ...
-1
votes
0
answers
30
views
How to write a service to run every mid night automatically using asp.net MVC
I want to create a service to run every midnight automatically using the asp.net MVC application. I refer to many articles, but I didn't get the correct way to do that.
Please help me to write that ...
0
votes
0
answers
5
views
PM2 Windows process stopped on the server but the express services on pm2 list are running
There is an interesting scenario where PM2 Service is stopped on the servers but the express services listed on the PM2 are still online and running.
It seems weird but could not figure out any ...
1
vote
0
answers
45
views
How do I access a mapped drive from a windows service?
I need to read some files from a mapped drive, I have to access this drive in a mapped way because it is outside the domain. This is troubling me because if I run my code as a Console application in C#...
0
votes
0
answers
12
views
Display a dialog box in the user’s session using the WTSSendMessage function in VisualBasic
I need to display a message through a windows service using VB.net.
I tried everything except that the windows service is no longer interacting with the user so no GUI will ever appear.
I found many ...
0
votes
1
answer
16
views
Cant add reference to a worker service in C#
I am trying and following a tutorial to add a Windows Service into mi WebApp to send emails periodically...
The main thing I can not do is add the ServiceProcess reference to use the ServiceBase.
I ...
0
votes
0
answers
21
views
What are the differences between device object and driver object?
I am trying to develop simple windows10 drivers (both plug&play and non plug&play). I would like to have a better grasp on how a user app interacts with the kernel. I would be glad to receive ...
-1
votes
1
answer
68
views
Access Current logged in Users download folder in c# windows service
i have windows service which is deployed using service.msc using c#,
i want to access the current logged in users download folder
eg: if the current logged in username is admin, then i want to access
...
0
votes
0
answers
14
views
Active directory compatible Linux DHCP servers
Can I use a Linux DHCP server for Windows Active Directory? If that's the case, please recommend the best Linux DHCP server packages that are compatible with Active Directory.
0
votes
1
answer
16
views
Why does my Windows Service built with .net 6.0 and Host.CreateDefaultBuilder fails at startup with DI errors?
I've spent too long on this not to share.
I made a Windows Service with .Net 6.0 and the Host.CreateDefaultBuilder method. It worked fine, was deployed correctly. Then I modified something that ...
0
votes
0
answers
14
views
How to add security/credentials to TcpListener class while accepting the request from client?
This is my email service application (server) which contains the code for send email
Below code is written to do on service startup to keep listen the requests from client
public IPEndPoint Endpoint { ...
1
vote
0
answers
22
views
SQL Server (SQLEXPRESS) Windows Service greyed out
I Installed SQL Server Express on my work PC, and had it up and running at the time of installation.
But I guess after a restart of PC, the Windows Service "SQL Server (SQLEXPRESS)" can no ...
0
votes
0
answers
129
views
Unable to Launch PM2 start pm2.json as Windows Service?
I launch the Node apps using the json file with pm2 using the command line pm2 start pm2.json and it always launched without any issues. However, I wanted to launch it via the Windows Service. So I ...
1
vote
1
answer
31
views
CreateProcessAsUser function to run a GUI program from a service
Below is the code I am using to run a GUI app from service application. I am passing cmd string "C:\Windows\notepad.exe".
It is not opening the Notepad and not even giving any error. hToken ...
0
votes
1
answer
35
views
Creating and starting Windows Service with .exe which has package identity over sparse package (.msix) to create PushNotificationChannel
I´m new to c#, .net core world and figuring out a POC for our needs.
Basically its a Windows Service created with .net core (like here explained: Create a Windows Service using BackgroundService). Our ...
0
votes
0
answers
27
views
Starting node process once and reusing it for execution of javascript file in c#
I am trying to run node and executing my javascript file using below code from c#. my c# application is running as windows service in windows server 2019 standard
string appjsloc = AppDomain....
0
votes
0
answers
25
views
Start exe from windows services
We have created on windows application, sometimes it is getting crashed, so it stopped from client end. Again user need to start the application manually. If we create windows service, incase the ...
0
votes
0
answers
26
views
Detect if system is about to restart or shutdown in Windows Service C program
I want to know if it is possible to detect whether the system is shutting down or about to restart from Windows Service code.
In my Windows service:
If system is going to restart, I want to perform ...
-1
votes
0
answers
18
views
How can I manage print jobs from an app running under the Local System account?
I am working on software that is used to control user session on Windows computers. Users are assigned a workstation and get to use it for a finite period of time. Our software ensures that ...
0
votes
0
answers
22
views
azure devops | win service restore | nuget failed
1 to 3 , runs of my CI i got that error
The nuget command failed with exit code(1) and error(MsBuild timeout out while trying to
get project to project references.
to solve it I just re run, but is ...
0
votes
1
answer
62
views
How to display message using WTSSendMessage?
I want to display some message to the user when a task is completed. But the Application is running as a service, so it's not possible to use a UI component.
Microsoft documentation says we can use ...
1
vote
1
answer
42
views
Self-hosted SignalR in Windows .Net Service blocked by CORS on same server, works on other servers
I've been using a Self-Hosted SignalR Windows service accessed from multiple production servers (now in Azure) for 6+ years without a problem. I created an identical server for development in Azure ...
0
votes
0
answers
25
views
Creating new AppDomain instances inside a Windows service doesn't work
I am trying to create a Windows service with C# which spawns multiple processes inside it.
For this I am using AppDomain functionality and creating multiple of them at startup in the OnStart method of ...
0
votes
1
answer
75
views
Cannot start windows service (.Net Core worker service) due to extra extension methods on IHostBuilder
Goal:
I'm trying to run a .Net Core 3.1 Worker service as a windows service.
Setup:
I've used the Worker service default template via Visual Studio.
To add windows service functionality to this, I ...
0
votes
0
answers
17
views
.Net Core Data Transfer
I have a .Net MVC 5 project with entity framework.
I need to transfer data to my database.
Connect a database from a server, get data from there
Connect another database from another server
Compare ...
1
vote
0
answers
49
views
Can Windows Service be started by incoming TCP connection?
I'd like to make a small Windows Service, that would be shutdown most of the time, but would be automatically activated when incoming TCP (REST?) connection comes. I do not want the service to be ...
0
votes
0
answers
27
views
Duplicate Record Fetching from Load Balancer System
One windows service is installed on two servers for load balancing. Both server nodes pointed to a single SQL Server database. How can we avoid duplicate records fetching from two server nodes? ...
0
votes
1
answer
38
views
Masstransit Consumer in .NET 4.8 Topshelf works only in Executable not in Service
we need to host a Masstransit RabbitMQ Consumer in a .NET 4.8 Windows Service.
We are using Dependency Injection and Topshelf to run, install and start the Service.
Running the Consumer as a Windows *....
0
votes
1
answer
56
views
Get Windows Service start parameters from HostBuilderContext
I am creating a Windows service using the Microsoft Generic Host. My code is notionally like this:
public static void Main(string[] args)
{
Host.CreateDefaultBuilder(args)
....
0
votes
0
answers
11
views
Authentication Issue with MS-SQL Server
I am trying to Install TeamMate+ (An audit application) on Windows Server 2019, and I am getting an “Error 5: Access is denied” when starting the services for the application.
After checking the ...
2
votes
1
answer
45
views
Windows Service recursive & infinite call
I have a Windows Service which connects to an external device (micro controller) to get data and save it to database. The external device does not support callback feature, that's why the service ...
0
votes
1
answer
159
views
Blazor server app hosted in Windows service
How can we host a Blazor server application as a Windows service? Using this article as a guide:
https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/windows-service?view=aspnetcore-6.0
We ...
0
votes
1
answer
150
views
System.IO.FileNotFoundException: Could not load file or assembly 'Windows' or one of its dependencies
I have an application which I am deploying on my home Windows server through BuildMaster and lately an error occurs while deploying. Mostly the error is when I restart the server and after several ...
1
vote
0
answers
23
views
How to create a windows service that runs a PHP script?
I have a PHP application that is connected to MS SQL and it runs a script, based on the time that is stored in the database, to execute a particular query of another database server.
Eg:
database has ...
0
votes
1
answer
111
views
FastAPI as a Windows service is running but can't get in 127.0.0.1:5000
So, i was trying to run FastAPI as a windows service. I tried the code witout uvicorn programitically to run in local server. It worked fine. But, with programatically to run as a service it start and ...
0
votes
0
answers
33
views
Can Windows Service change its own password on start?
Question: Is it possible to update the password for the windows service during startup of that windows service (in the C# implementation of the windows service)?
Background:
We store passwords in the ...
0
votes
1
answer
24
views
How to set Recovery options in Windows services using SaltStack
I'm creating a custom Windows Service and deploying it on my salt-minions using Salt master.
The code for it is as follows:
create_service_{{servicename}}:
module.run:
- name: service.create
...
1
vote
1
answer
21
views
installing a service app from .NET does not install it
I have read the other similar posts on this forum! However they haven't helped me
I'm using Visual Studio 2019 Team System, on Windows 10. My Windows account has admin privileges,
Here is what I have ...
0
votes
0
answers
16
views
Reading parameter while Windows Service is running
How can I check if there is an external parameter when my application is running and how can I start a new thread if there is an incoming parameter?
protected override void OnStart(string[] args)
{
...
0
votes
0
answers
70
views
Detect system hibernate(S4) from .NET Windows Service?
I am writing a windows service application in .NET/C#.
My service has to be notified when the system enters in hibernation(S4). How to do this in code?
Looks like ServiceBase.OnPowerEvent() method ...
0
votes
1
answer
185
views
.NET 5 WindowsService with ASP.NET Core and BackgroundService
I'm new here and new to .NET 5, and I'm really stuck with my problem.
I have an .NET 5 application that should be executed as a Windows Service and that has an ASP.NET Core (Kestrel?) REST service and ...
0
votes
1
answer
25
views
Determine if a running Windows Service is functioning
Most of us have experienced a Windows service that has a status of "running" but is not doing what it is supposed to and we often restart the service. I would like to know if there is a way ...
0
votes
0
answers
17
views
ThreadPool.SetMinThreads returns false
We have a server that allows thousands of TCP connections to connect on port 52999 and exchange data. Each connection has its own thread. So there are thousands of threads.
If I keep the ThreadPool's ...
0
votes
0
answers
39
views
Creating a background service in .net 5 without running powershell
I am creating a simple background service in .NET5 like the one in this Microsoft tutorial https://docs.microsoft.com/en-us/dotnet/core/extensions/windows-service.
After publishing the document says ...
0
votes
0
answers
30
views
How to check windows service status using .Net 6 web application?
I need to find a way to monitor the status of a list of Windows services over HTTP using .Net 6 web application.
All I really need to be able to do is display the service name and its status ('Started'...
0
votes
0
answers
32
views
Using smart card certificate in Windows service application
I have .net 5 Web api application hosted as Windows service.
Application is using X509 certificate from a smart card.
Certificate is used for http authentication for a remote service.
Certificate is ...
0
votes
1
answer
21
views
Service Control Manager (sc.exe) fails when using a localhost alias in hosts file, but succeeds when using the loopback address directly
I am running the command:
sc \\My-Server create TestService binPath= "C:\Test\Test.exe"
However, it fails with
[SC] OpenSCManager FAILED 5:
Access is denied.
My hosts file contains:
127.0....
0
votes
1
answer
513
views
Serilog file logging not written from Worker Service when running as service
I am writing a worker service that needs to use Serilog and write to a log file. (.net core 6 and Windows service). The same service, when using Microsoft.Extensions.Logging and writing event logs as ...
0
votes
2
answers
647
views
ASP.NET Core (.Net 6) Web Application throws System.NotSupportedException when run as a service. (Service will not start)
When I attempt to run my .Net Web Application as a Windows Service, it does not start. It works if I just run the executable but mysteriously fails when attempting to run as a service. I have logged ...