denious

Untitled

Nov 4th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. using Microsoft.ServiceFabric.Services.Runtime;
  2. using System;
  3. using System.Diagnostics;
  4. using System.Threading;
  5. using System.Threading.Tasks;
  6.  
  7. namespace WebStaticOcelotHttps
  8. {
  9. internal static class Program
  10. {
  11. /// <summary>
  12. /// This is the entry point of the service host process.
  13. /// </summary>
  14. private static void Main()
  15. {
  16. try
  17. {
  18. // The ServiceManifest.XML file defines one or more service type names.
  19. // Registering a service maps a service type name to a .NET type.
  20. // When Service Fabric creates an instance of this service type,
  21. // an instance of the class is created in this host process.
  22.  
  23. ServiceRuntime.RegisterServiceAsync("WebStaticOcelotHttpsType",
  24. context => new WebStaticOcelotHttps(context)).GetAwaiter().GetResult();
  25.  
  26. ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(WebStaticOcelotHttps).Name);
  27.  
  28. // Prevents this host process from terminating so services keeps running.
  29. Thread.Sleep(Timeout.Infinite);
  30. }
  31. catch (Exception e)
  32. {
  33. ServiceEventSource.Current.ServiceHostInitializationFailed(e.ToString());
  34. throw;
  35. }
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment