When I try to publish an azure webjob, I get the following error:
An error occurred while creating the WebJob schedule: Could not load type 'Microsoft.IdentityModel.Clients.ActiveDirectory.ActiveDirectoryAuthenticationException' from assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.16.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
The same question is asked in Visual Studio 2015 Publish WebJobs Issue, but the accepted answer does not solve my case.
I tried to add the nuget package for ActiveDirectory version 2.16, but that didn't solve it either.
There is now a better way of scheduling WebJobs using CRON expressions, which is simpler and avoids all the Scheduler issues.
I have added a new answer to the existing question, to keep everything in context of the original answers.
See details on Visual Studio 2015 Publish WebJobs Issue