问题
I'm a newbie to .net core and have a question about how to schedule multiple .net core console apps in the Windows task scheduler. How I was able to schedule a test console app was to set the program/script to "dotnet", the args to "mytestnetcoreconsoleapp.dll", and the startup directory to that which contained the dll. Would this be correct to do for multiple console apps though? From what I understand about the task scheduler, having multiple tasks with the same program name is a no no. I also realize instead of framework dependent deployment (FDD) I could do self contained deployment (SCD) for each console app so as to get uniquely named exe files but that would explode the size of each deployment as they'd each have a copy of the core dlls, right?
回答1:
set the program/script to "dotnet" <- this does not work, at least not anymore. For some reason task scheduler mandates full path and filename, so you need to enter there "C:\Program Files\dotnet\dotnet.exe". Confirmed this on Windows Server 2012 R2 with latest patches.
the args to "mytestnetcoreconsoleapp.dll" <- correct
the startup directory to that which contained the dll <- correct
来源:https://stackoverflow.com/questions/44849115/scheduling-multiple-net-core-console-apps