Symbol.ServiceHost 1.3.0.38

服务宿主

请在服务最终运行项目中,启动服务,以下为 Program.cs 参考代码:
/// <summary>
/// 程序入口类
/// </summary>
static class ServiceProgram {

   /// <summary>
   /// 主函数入口
   /// </summary>
   /// <param name="args">参数列表。</param>
   static void Main(params string[] args) {

       //以管理员身份运行检测:调试模式时建议关闭,反之必须以管理员身份运行visual studio
       //Symbol.ServiceHost.ProgramHelper.RunAsAdminCheck = false;

       //自适应模式
       Symbol.ServiceHost.ProgramHelper.Run(args);

       //强制运行为服务
       //Symbol.ServiceHost.ProgramHelper.Run("/service");

       //强制运行为桌面程序
       //Symbol.ServiceHost.ProgramHelper.Run("/exe");
   }
}

请在服务最终运行项目中,创建配置文件,取名为 symbol.service.host.config(编码为utf-8),并设置输出到目录,以下为参考配置:
<?xml version="1.0" encoding="utf-8"?>
<symbol.service.host.config xmlns="http://www.afuhao.org/schemas/xsd/symbol.service.host.config.xsd">
 <!--宿主配置信息-->
 <host name="My.MasterService"
       displayName="我的服务"
       description="此服务停止后,功能无法使用。"
       allowUI="false" startMode="Automatic" accountType="LocalSystem" />
 <services>
   <!--服务配置节点,可以为多个;order为启动优先级-->
   <!--如果只有一个服务时,可以与Host的命名一致-->
   <service name="My.MasterService"
            displayName="我的服务"
            allowUI="false" startMode="Automatic" accountType="LocalService"
            order="1">
     <description>服务描述</description>
     <!--服务的入口程序集与服务类全称-->
     <assembly name="My.MasterService.dll"
               type="My.MasterService.CoreMasterService, My.MasterService" />
     <settings>
       <!--没有配置信息时可以省略-->
       <setting name="key1" value="value1"/>
     </settings>
   </service>
 </services>
</symbol.service.host.config>

Install-Package Symbol.ServiceHost -Version 1.3.0.38
dotnet add package Symbol.ServiceHost --version 1.3.0.38
<PackageReference Include="Symbol.ServiceHost" Version="1.3.0.38" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Symbol.ServiceHost --version 1.3.0.38
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

+ runtime

  • .net framework 3.5
  • .net framework 4.5.2
  • .net framework 4.6
  • .net framework 4.6.1
  • .net framework 4.7

? next version

  • .net core app 3.0

+ runtime

  • .net framework 3.5
  • .net framework 4.5.2
  • .net framework 4.6
  • .net framework 4.6.1
  • .net framework 4.7

? next version

  • .net core app 3.0

Release Notes

兼容旧项目

  • .NETFramework 3.5

    • No dependencies.
  • .NETFramework 4.0

    • No dependencies.
  • .NETFramework 4.5

    • No dependencies.
  • .NETFramework 4.5.2

    • No dependencies.
  • .NETFramework 4.6

    • No dependencies.
  • .NETFramework 4.6.1

    • No dependencies.
  • .NETFramework 4.7

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.3.0.38 150 12/3/2019
1.3.0.36 181 7/29/2019
1.3.0.35 194 7/9/2019
1.3.0.34 163 7/5/2019
1.3.0.33 170 7/3/2019