How to execute .Net Core 2.0 Console App using Windows Task Scheduler?

試著忘記壹切 提交于 2020-01-02 01:13:10

问题


I have one Console App which is created using asp.net Core 2.0 in VS2017. Now I want to run this application on particular time period repeatedly (like service). So I have tried this using Windows Task Scheduler but when we create task using Task Scheduler it ask for .exe file of Console app. (please check below pic)

But as you can see that When we create Console App using .Net Core 2.0 there will no .exe file under bin/debug folder. Anyone have idea that how to schedule a .net Core 2.0 console app using Windows Task Scheduler ? Any suggestions will be highly appreciated !

Thanks,


回答1:


Just call dotnet and pass in dll you wish to run as argument. You can either specify the full path in the argument or set the path where your dll resides in the "Start in" field. You should use the published dll and NOT the development dll that gets created in the project's bin folder.



来源:https://stackoverflow.com/questions/52946410/how-to-execute-net-core-2-0-console-app-using-windows-task-scheduler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!