Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. namespace ExemploService.ConsoleApplicationNetCore
  2. {
  3. class Program
  4. {
  5. static void Main(string[] args)
  6. {
  7. //Variavel para verificar se esta em modo Debug a execução do serviço.
  8. var isService = !(Debugger.IsAttached || args.Contains("--console"));
  9.  
  10. using (var servico = new ScheduleServices())
  11. {
  12. if (isService)
  13. ServiceBase.Run(servico);
  14. else
  15. servico.onDebug();
  16. }
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement