Azure-functions-core-tools: Azure Functions Tools Release 2.18.4 Breaks Dependency Injection

Created on 25 Mar 2019  路  20Comments  路  Source: Azure/azure-functions-core-tools

I was automatically updated to Azure Functions Tools Release 2.18.4 today. I have been using Automapper with Azure Functions, with no problems. However after visual studio automatically updated to tools version 2.18.4 Automapper DI now fails. When I manually tricked vs to use the old version 2.18.3, the exception is fixed..

When running 2.18.3 these are the versions I get on start up

image

and 2.18.4

image

and I now get a error 'Microsoft.Extensions.DependencyInjection.Abstractions: Unable to resolve service for type 'AutoMapper.IMapper' while attempting to activate '....'

All 20 comments

We experience this as well. There seems to be a breaking change or a bug in the 2.4.498 version. Running manually with func start with the 2.4.419 version of the NPM package also works.

@jzoss this is a result of a regression introduced with the last release of the host and tools. The fix has been made and it is currently rolling out to azure. A Core Tools release will take place when that deployment completes.

@fabiocav Could you please link the appropriate commits to this issue and resolve when the deploy and new Core Tools are in place?

Any ETA on the core tools release?

@fabiocav Awesome news, Thanks for the quick fix.

Hi - any ETA on the Core Tools fix, or a workaround ?

When is the fix going to be rolled out? Can we somehow downgrade the tools in visual studio?

@fabiocav Any update on this? This is halting our development at the moment

same here

Yes, the fix is rolling out to Azure and once the deployment completes there, the Core Tools targeting that host will be released. We expect that to happen at the end of the week.

@fabiocav how can we roll back to previous version of tools? Our development effort is stuck.

@fabiocav how can we roll back to previous version of tools? Our development effort is stuck.

from Jaffacakes82: If you're still having the issue I did the following to resolve npm install -g [email protected] and ensure your launch settings are executing this host. I had multiple installations of the core tools for some reason.

@miantosca I tried that but even though I'm getting the right version on load, the DI still doesn't work. now I'm totally confused.

Globally installed core tools version

+-- [email protected]

Launch settings

  "LocalFunctionsCLI": {
      "commandName": "Executable",
      "executablePath": "dotnet.exe",
      "commandLineArgs": "%userprofile%\\AppData\\Roaming\\npm\\node_modules\\azure-functions-core-tools\\bin\\func.dll host start"
    }

Console output

Azure Functions Core Tools (2.4.419 Commit hash: c9c1724d002bd90b2e6b41393915ea3a26bcf0ce)
Function Runtime Version: 2.0.12332.0

Exactly... there are some details here as well: https://github.com/Azure/app-service-announcements-discussions/issues/85#issuecomment-476382217

Hi - any ETA on the Core Tools fix, or a workaround ?

Version 2.18.5 now installed and DI working again. Thanks @fabiocav et al.

Updated to latest tools, looking good. Thanks for quick turnaround!

Updated to latest tools, looking good. Thanks for quick turnaround!

@rhythmnewt which version? I don't see a newer one than the one from 3-days ago 2.4.498

I see 2.5.553 in the releases. How long before they show up npm? I downloaded the zip - are there instructions on installing from the zip?

I updated the tools through Visual Studio update tools command.

Azure Functions Core Tools (2.5.553 Commit hash: b63f2d6f5479718ca276f7b585a8cc6b9bc57c4f)
Function Runtime Version: 2.0.12382.0

[email protected] should be released in all supported package managers (including npm).

Closing this issue. Please re-open if you continue to see issues.

Was this page helpful?
0 / 5 - 0 ratings