Program.cs 985 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using Autofac;
  2. using EMIS.Utility;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.ServiceProcess;
  7. using System.Text;
  8. namespace EMIS.Service
  9. {
  10. static class Program
  11. {
  12. public static readonly Autofac.IContainer AutofacContainer;
  13. static Program()
  14. {
  15. var builder = new ContainerBuilder();
  16. builder.RegisterModule<EMIS.CommonLogic.DALModule>();
  17. builder.RegisterModule<EMIS.CommonLogic.ServiceModule>();
  18. var _container = builder.Build();
  19. AutofacContainer = _container;
  20. AutofacHelper.Container = _container;
  21. }
  22. /// <summary>
  23. /// 应用程序的主入口点。
  24. /// </summary>
  25. static void Main()
  26. {
  27. ServiceBase[] ServicesToRun;
  28. ServicesToRun = new ServiceBase[]
  29. {
  30. new Service1()
  31. };
  32. ServiceBase.Run(ServicesToRun);
  33. }
  34. }
  35. }