毎分メッセージを出力する単純なコンソール アプリを作成しました。「開始中」という最初の印刷メッセージは表示されますが、メッセージは表示されませんPrintTest()
私のコンソールの方法。この理由は何ですか?ところで、これは .net コア コンソール アプリケーションです。
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Starting");
GlobalConfiguration
.Configuration
.UseSqlServerStorage(@"Server=127.0.0.1,1433; Database=HFTest; User Id=sa; Password=Password123");
RecurringJob.AddOrUpdate((() => PrintTest()), Cron.Minutely());
Console.ReadKey();
}
public static void PrintTest()
{
Console.WriteLine("Hangfire Server started. Press any key to exit...");
}
}