DotNetCore.WindowsService | Simple library | Configuration Management library
kandi X-RAY | DotNetCore.WindowsService Summary
kandi X-RAY | DotNetCore.WindowsService Summary
Simple library that allows one to host dot net core application as windows services. Perfect solution to power micro-services architecture.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of DotNetCore.WindowsService
DotNetCore.WindowsService Key Features
DotNetCore.WindowsService Examples and Code Snippets
Community Discussions
Trending Discussions on DotNetCore.WindowsService
QUESTION
I am trying to set up a .Net Core Console application as a service. Using .Net standard I usually make use of Topshelf but this does not seem to support .Net Core.
Since Topshelf is not an option what can I do to run the the .Net Core Console application as a Windows service?
I have come access https://github.com/PeterKottas/DotNetCore.WindowsService, is this a viable substitute for a production environment?
...ANSWER
Answered 2018-May-22 at 22:34At our company we use Non-Sucking Service Manager which so far I had no problems with, you might want to have a look.
QUESTION
I have built a windows service in DotNet Core that is installed with the Peter Kottas WindowsServer nuget (https://github.com/PeterKottas/DotNetCore.WindowsService). In order to install the service you have to publish the code, deploy it wherever, run cmd prompt with administrator rights, move directory to the deployed code and execute the following line: "MyService action:install"
...ANSWER
Answered 2017-Aug-31 at 15:10You must mark your CustomActions as Execute="Deferred"
The InstallExecuteSequence happens in two parts, the first is a planning phase where it figures out what it will be doing and the second part is running the plan script it just made in an elevated context.
If you plan some custom actions in the InstallExecuteSequence but do not mark them deferred, they will run during the planning part of the execute sequence which is before any of the files have been installed because the InstallFiles standard action requires elevation and that happens in the 2nd part of the sequence when it runs the planned script.
Generally you use this pattern when you need to run an elevated custom action that needs property values from your install. You schedule two custom actions, one deferred and one not, where the non-deferred action actually sets some special values to be used by the deferred action when it executes.
I haven't used the Directory attribute for CustomActions before so you may need to re-write some of these actions to get them to work, I'm not sure.
This other question's answer should help explain a bit how deferred custom actions get values at runtime from properties of the installer if you need to change the way your custom actions work.
WiX - commit more than one Property to deferred Custom Action
QUESTION
There are lots of articles talking about how to use Structure Map with ASP.NET Core, but not very many talking about console applications or windows services. The default behavior in ASP.Net Core is that StructureMap creates a Nested Container per HTTPRequest so that a concrete class will be instantiated only once per HTTP Request.
I am creating a .Net Core Windows Service using the PeterKottas.DotNetCore.WindowsService nuget package. I setup StructureMap using this article: https://andrewlock.net/using-dependency-injection-in-a-net-core-console-application/
My windows service is setup on a Timer and performs an action every X number of seconds. I want each of these actions to use a nested container similar to how ASP.NET does it. In other words, I want everything created for polling pass #1 to be disposed of once that polling pass completes. When polling pass #2 starts I want all new instances of objects to be instantiated. However, within the scope of a single polling pass I only want one instance of each object to be created.
What is the proper way to do this?
Here is my program class
...ANSWER
Answered 2017-Dec-21 at 13:15There is extension method CreateScope
for IServiceProvider
in Microsoft.Extensions.DependencyInjection
namespace. What it does is resolve special interface (IServiceScopeFactory
) from current DI container, which is responsible for creating new scopes, and creates new scope using this factory. StructureMap registers implementation of this interface, so when you call CreateScope
- StructureMap will create nested container. Sample usage:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install DotNetCore.WindowsService
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page