-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Milestone
Description
在使用过程中发现, 如果是C#控制台程序,里面本身用到了timer做定时任务所以在main函数里使用了Console.ReadKey()来阻塞。
然后用winsw注册成系统服务后,点击开启服务,会报错
System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.
at System.Console.ReadKey(Boolean intercept)
at ServiceActiveConsole.Program.Main(String[] args)