Open MauriRojas opened 5 years ago
Hi, I have the same issue, I'm interested to get the answer too.
Error message returned is:
Executed 'MyFunction' (Failed, Id=1fbfba73-3dc8-482d-b71a-0a3a02e61481) [29-May-19 18:45:44] Microsoft.Extensions.DependencyInjection.Abstractions: Unable to resolve service for type 'MyProject.Services.IMyService' while attempting to activate 'MyProject.MyFunction'.
Is your question related to a specific version? If so, please specify:
Is not related to any version.
What language does your question apply to? (e.g. C#, JavaScript, Java, All)
C#
Question
Is it possible to integrate
Microsoft.Azure.Functions.Extensions
with Autofac using this approach? The idea is to register the dependencies using Autofac and resolve them in the functions.So far I've tried using the
IServiceCollection.AddAutofac()
method ofAutofac.Extensions.DependencyInjection
with the following implementation:But it fails when resolving the registered dependencies in the functions class: