extensionBundle in host.json breaks DI
bcraun opened this issue · 1 comments
bcraun commented
I have an issue I finally traced to the extensionBundle
changes in host.json
which are causing DI to not work in a queue-triggered function. I am using IFunctionsHostBuilder and it works correctly if the extensions are omitted.
DI works:
{
"version": "2.0"
}
DI doesn't work:
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[1.*, 2.0.0)"
}
}
My queue-triggered function still works without the extensionBundle
specified and I would like to understand under what scenarios are they needed?
Thanks
jeffhollan commented
If using Dependency Injection (or .net code in general) you do not need and should not use extension bundles. Extension bundles are for bundling in extensions (which in .net you pull in as NuGet packages) to the app