计划多个.net核心控制台应用程序

计划多个.net核心控制台应用程序

问题描述:

我是.net core的新手,并且对如何在Windows任务计划程序中安排多个.net core控制台应用程序有疑问。我如何安排测试控制台应用程序的方法是将程序/脚本设置为 dotnet,将args设置为 mytestnetcoreconsoleapp.dll,并将启动目录设置为包含dll的目录。不过,对于多个控制台应用程序这样做是否正确?据我对任务计划程序的了解,具有相同程序名称的多个任务是不行的。我还意识到,我可以代替每个框架应用程序进行独立的部署(SCD),而不是依赖框架的部署(FDD),以便获得唯一命名的exe文件,但是这会扩大每个部署的规模,因为它们每个都有一个副本。核心dll,对不对?

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?

将程序/脚本设置为 dotnet<-这将不起作用,至少现在不再起作用。由于某种原因,任务计划程序要求使用完整路径和文件名,因此您需要在此处输入 C:\Program Files\dotnet\dotnet.exe。在Windows Server 2012 R2上使用最新的补丁程序对此进行了确认。

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.

mytestnetcoreconsoleapp.dll的参数

the args to "mytestnetcoreconsoleapp.dll" <- correct

包含dll的启动目录

the startup directory to that which contained the dll <- correct