I am do I migration to .standard to .core, but I faced a problem:
Microsoft.Azure.WebJobs.Host: Error indexing method 'FunctionName'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'MyService' to type IMyService. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
I am using a startup with autofac to resolve the dependency
public sealed class Startup : IExtensionConfigProvider
{
private static IContainer container;
public void Initialize(ExtensionConfigContext context)
{
var builder = new ContainerBuilder();
builder.RegisterType<MyService>().As<IMyToCoreService>().InstancePerDependency();
container = builder.Build();
context.AddBindingRule<InjectAttribute>().BindToInput<dynamic>(inject => container.Resolve(inject.Type));
}
}
The NuGets are:
Autofac - 4.9.0
Microsoft.Azure.WebJobs.Extensions.Storage - 3.0.3
Microsoft.NET.Sdk.Functions 1.0.24
And the function:
public static async Task RunAsync([QueueTrigger(ASERVICETOGETANAME)]string blobInformation,
[Inject(typeof(IMyService))]IMyService myService,
ILogger log, CancellationToken cancellationToken)
I try to downgrade the versions of nuget and .net core, but I didnt have any success, what more can I do resolve the dependency problem?
EDIT - The Startup class is not being called.