New Azure WebJob Project - JobHostConfiguration/RunAndBlock missing after NuGet updates
- 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
So I install
This resolves QueueTriggerAttribute
But in program.cs
static void Main()
var config = new JobHostConfiguration();
var host = new JobHost(config);
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.
- 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!
- .Net Framework 4.6.2
- Visual Studio 2017 - v15.8.7
The 3.0.0 NuGet package update (non-beta) brought breaking changes. It's based on the generic host which is similar to the asp.net host. Here's an example of the new setup
Here you can find a GitHub discussion related to that topic.