我已经使用 Visual Studio 2013 从 File > new > Website (not project ) 创建了空的 asp.net webforms 网站并安装了 Hangfire 库。然后我在 App_code 和根文件夹中添加了 Startup.cs 文件。然后我在 Global.ascx 文件中创建了简单的测试
void Application_Start(object sender, EventArgs e)
{
Hangfire.RecurringJob.AddOrUpdate(() => Console.WriteLine("I am done!"), Hangfire.Cron.Minutely);
}
当我尝试运行该网站时,它会返回
JobStorage.Current property value has not been initialized. You must set it before using Hangfire Client or Server API.
但是如果我创建一个项目并执行相同的步骤,它运行没有任何问题,任何人都可以提供帮助吗?