我使用TimerTrigger CRON的工作计划任务为2天,但是触发似乎没有工作。 以下是代码我尝试过,
public static void StartupJob([TimerTrigger("0 * * * * *", RunOnStartup = true)] TimerInfo timerInfo) //0 * * * * * added CRON job to run for every minute for testing purpose
{
Console.WriteLine("Timer job fired!");
}
地方。设置。json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
}
}
作为上述代码没有工作我已经加入了以下主要()
static void Main()
{
var config = new JobHostConfiguration();
config.UseTimers();
config.Tracing.ConsoleLevel = System.Diagnostics.TraceLevel.Verbose;
if (config.IsDevelopment)
{
config.UseDevelopmentSettings();
}
var host = new JobHost(config);
// The following code ensures that the WebJob will be running continuously
host.RunAndBlock();
}
获得以下错误,并表示修正如安装DocumentFormat包装,但是安装这种软件包并不是解决的函数的错误。
我是个新手C#和无法找到什么是这里的问题。 任何帮助或参照良好的实例会有帮助,并赞赏。
谢谢你。