windows-services

Dockerizing a Windows Service

折月煮酒 提交于 2020-04-18 01:10:18
问题 I am new to docker and I have an application including a set of windows services (.NET). I d like to run it into a docker container. What should I do ? 回答1: In general, you should choose a base image which has the necessary libraries already installed on it as much as possible instead of taking a very base image such as plain Linux or Windows and installing on it. In your case, select a docker image which has .NET installed on it.This image for instance The ideal flow is as follows. Select

ASP.Net Core 2.1 application cannot find appsettings.json when ran as a Windows service

老子叫甜甜 提交于 2020-04-13 17:06:38
问题 I am trying to run my ASP.Net Core 2.1 application as a service on Windows 10. My application runs fine when ran using VS2017 or if I publish to a folder and then start it from within that published folder with the --console arg. However, if I use sc create to create the service, getting a Success result, and then try to run it, I get an error in the Windows Application log stating... System.IO.FileNotFoundException: The configuration file 'appsettings.json' was not found and is not optional.

ASP.Net Core 2.1 application cannot find appsettings.json when ran as a Windows service

痞子三分冷 提交于 2020-04-13 17:00:07
问题 I am trying to run my ASP.Net Core 2.1 application as a service on Windows 10. My application runs fine when ran using VS2017 or if I publish to a folder and then start it from within that published folder with the --console arg. However, if I use sc create to create the service, getting a Success result, and then try to run it, I get an error in the Windows Application log stating... System.IO.FileNotFoundException: The configuration file 'appsettings.json' was not found and is not optional.

Https calls are not connecting to server

随声附和 提交于 2020-04-07 04:30:19
问题 I am working on Windows Service in visual studio 2017. In the rest api's call, getting exceptions while debugging code. Sometimes first 2 3 calls working after that getting exceptions. System.Net.WebException: 'The remote server returned an error: (503) Server Unavailable.' The remote server returned an error: (429) Unable to connect to the remote server When calling same api's from Postman, getting response successfully. This is my code private void timer1_Tick(object sender,

Https calls are not connecting to server

一笑奈何 提交于 2020-04-07 04:29:08
问题 I am working on Windows Service in visual studio 2017. In the rest api's call, getting exceptions while debugging code. Sometimes first 2 3 calls working after that getting exceptions. System.Net.WebException: 'The remote server returned an error: (503) Server Unavailable.' The remote server returned an error: (429) Unable to connect to the remote server When calling same api's from Postman, getting response successfully. This is my code private void timer1_Tick(object sender,

Do you have to restart a windows service if you change the app.config?

馋奶兔 提交于 2020-03-17 05:33:14
问题 Do you have to restart a windows service if you change the app.config? 回答1: Yes, you do: .Net framework will read the app.config once, and never touch the app.config again. That is why you have to restart the application to pick up the change. Why does not .Net framework detect that app.config has changed, and refresh all the config data? The reason is simple, this is not possible in general. Let’s use Raymond’s “imagine this could be done” logic here... 回答2: I've used this before.

Folder to dump windows service log files

ε祈祈猫儿з 提交于 2020-03-06 09:18:11
问题 Short: What's the most appropriate folder for windows service to dump log files into? Details I have a windows service that produces log files that a low-tech end user might be interested to look at (actual communication between a computer and a manufacturing line monitoring sensors). The computer is a stand-alone dedicated computer that acts as a data acquisition server, it has monitor and accessible to the end user, but not meant to be touched unless there are problems. What's the best

How can I get custom action data of a setup project in C#?

别等时光非礼了梦想. 提交于 2020-03-05 04:05:28
问题 I create a windows service and a setup project for my service. In my windows service I can get my customer action data thinks to this : Context.Parameters["dbname"] But I want to access to the value of my customer action data in my service to use it in my project. Someone have any idea how to do it in c# ? UPDATE In my ProjectInstaller : public ProjectInstaller() { InitializeComponent(); } public override void Install(IDictionary stateSaver) { base.Install(stateSaver); string dbName = Context

How can I get custom action data of a setup project in C#?

强颜欢笑 提交于 2020-03-05 04:05:08
问题 I create a windows service and a setup project for my service. In my windows service I can get my customer action data thinks to this : Context.Parameters["dbname"] But I want to access to the value of my customer action data in my service to use it in my project. Someone have any idea how to do it in c# ? UPDATE In my ProjectInstaller : public ProjectInstaller() { InitializeComponent(); } public override void Install(IDictionary stateSaver) { base.Install(stateSaver); string dbName = Context

C# Windows Service that connects to network through VPN

二次信任 提交于 2020-03-05 01:34:58
问题 I have a Windows Service that must connect, via VPN, to the network in order to send emails. What I need to do (when I start the service) is check whether the VPN connection exists, if not create it, and then connect to the network. I was looking at DotRAS which looks ideal for doing all the work, however, it doesn't seem to provide a method for creating a new VPN connection. So my question is, is there a way in which I can programmatically create a VPN connection? 回答1: Use a scriptable VPN