Task.Factory.StartNew not executing the task when deployed

后端 未结 3 1967
余生分开走
余生分开走 2021-01-13 07:14

I have some code here that works as expected when I install it / run it on my own computer, Windows 7, but when I run it on other servers (2003 and 2008) it does not. The co

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-13 07:49

    Do any log messages get printed in the log? Do you see "MonitorMainQueue called" get printed? How do you know the second Task is started but not the first? Could it be a permission issue with creating/writing to the log file?

    Edit: Additionally, in response to what @spender said about long running tasks, there is an overload to start the task with that option.

    Task.Factory.StartNew(MonitorMainQueue, TaskCreationOptions.LongRunning);

提交回复
热议问题