Easy Replication
- Create a new project 'ASP.NET Web Application (.NET Framework).
- Build compile, update NuGet, all works.
- Add: Add New Azure WebJob Project.
- Build, compile. Happy
- Update NuGet for the WebJob project.
- Project no longer compiles.
Breaking changes were introduced https://github.com/Azure/app-service-announcements/issues/129
So I install
Microsoft.Azure.WebJobs.Extensions.Storage
This resolves QueueTriggerAttribute
But in program.cs
static void Main()
{
var config = new JobHostConfiguration();
if (config.IsDevelopment)
config.UseDevelopmentSettings();
var host = new JobHost(config);
host.RunAndBlock();
}
I am encountering the following problems:
- JobHostConfiguration is now missing.
- JobHost constructor now has two parameters, including a new IJobHostContextFactory?
- RunAndBlock is missing. It is now 'StartAsync'
- The code now needs to become asynchronous since there are no synchronous calls to the job.
Questions:
- What additioanl assemblies need to be installed?
- What is this new JobHostContextFactory?
- How do I configure the job now?
- How should I update the code for asynchronous?
- How do I block for a continuous job now that all we have is Start?
Thanks in advance!
- C#
- .Net Framework 4.6.2
- Visual Studio 2017 - v15.8.7