Info
Version: | 1.0.0.5 |
Author(s): | cnat |
Last Update: | Monday, June 19, 2017 |
.NET Fiddle: | Create the first Fiddle |
NuGet Url: | https://www.nuget.org/packages/System.Utility.Commons.Core.ServiceBaseController.dll |
Install
Install-Package System.Utility.Commons.Core.ServiceBaseController.dll
dotnet add package System.Utility.Commons.Core.ServiceBaseController.dll
paket add System.Utility.Commons.Core.ServiceBaseController.dll
System.Utility.Commons.Core.ServiceBaseController.dll Download (Unzip the "nupkg" after downloading)
Dependencies
- System.Utility.Commons.Core.Log.dll(>= 1.0.0)
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[RunInstaller(true)]
public class Program : System.Utility.Commons.Core.ServiceBaseInstaller
{
public static void Main(string[] args)
{
using (Program setting = new Program())
{
setting.RunService<Service1>(args);
}
}
}
//下面是配置文件中的设置
<appSettings>
<!--本服务的名称-->
<add key="InstallerServiceName" value="WinServices.ServiceTest" />
<!--本服务的显示名称-->
<add key="InstallerDisplayName" value="WinServices.ServiceTest" />
</appSettings>.