Not working with Microsoft.Extensions.DependencyInjection v2.2.0
See original GitHub issueThis may be a duplicate of #21, although that doesn’t capture the impact.
We’ve just updated our project to .NET Core 2.2 / EF Core 2.2, which means the datalayer class library our Functions project references now has a dependency on Microsoft.Extensions.DependencyInjection >= 2.2.0
This causes the following error on startup:
[17/12/2018 14:51:49] A host error has occurred
[17/12/2018 14:51:49] Willezone.Azure.WebJobs.Extensions.DependencyInjection: Method not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Azure.WebJobs.IWebJobsBuilder.get_Services()'.
Value cannot be null.
Parameter name: provider
This prevents the function from starting.
If I downgrade the data layer back to 2.1.x libraries, the error goes away. If I then add an explicit reference to Microsoft.Extensions.DependencyInjection v2.2.0 to the functions project, it comes back, so it looks like this is the culprit.
For reference, both the Function project and the class library it’s referencing are netstandard2.0. My local functions runtime is 2.0.12210.0, while Azure is running 2.0.12246.0 - same issue seen in both.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:6
Top GitHub Comments
@adrianm64 Another option would be to more active manage this project + nuget. And keep the same version scheme as from Microsoft.
So make multiple versions from
Willezone.Azure.WebJobs.Extensions.DependencyInjection
which align withMicrosoft.Azure.WebJobs
:For those running into this issue, I found I was able to get past it by updating my Azure Functions Runtime that ships with VS for Mac to latest as of this posting
This SO post pointed me in the right direction: https://stackoverflow.com/questions/55377996/net-core-2-2-azure-function-v2-dependency-injection