Reputation: 345
It seems that Microsoft.NET.Sdk.Functions version 3.0.4 broke DI with EntityFrameworkCore.
With 3.0.3, I can add an InMemoryDatabase in the DI and use it in my Function, but upgrading to 3.0.4 breaks stating:
Microsoft.Extensions.DependencyInjection.Abstractions: Unable to resolve service for type 'AzureFunction.Contexts.TestContext' while attempting to activate 'AzureFunction.TestFunction'.
I made the repro project available with picture (see images/) here
Upvotes: 1
Views: 130
Reputation: 29940
Yes, it's an issue in Microsoft.NET.Sdk.Functions version 3.0.4.
You can try it on the 3.0.5 which is released a few hours ago and DI issue is fixed.
Upvotes: 1