0

When migration Azure function v3 to version v4, using this guideline the Azure function is failing to start due to a file not found error. I have followed the Migration guideline and still not succeeding, how would I solve this?

Copy of Exception:

Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=*****'. The system cannot find the file specified. at ***.***.Startup.Configure(IFunctionsHostBuilder builder)

I am also getting a Runtime version: Error

Coder3000
  • 119
  • 2
  • 7

1 Answers1

0

I tried upgrading by creating a net core 3.1 function and adding dependency injection like explained here:

https://learn.microsoft.com/en-us/azure/azure-functions/functions-dotnet-dependency-injection

I have that using: Microsoft.Azure.Functions.Extensions.DependencyInjection; But I see you use "Microsoft.Extensions.DependencyInjection.Abstractions".

It upgraded right after I changed the target:

enter image description here

did you try to run the nuget under the VS console?

Install-Package Microsoft.Extensions.DependencyInjection.Abstractions -Version 6.0.0 or try enter image description here

the last resource would be creating a new project V4 using isolated mode and move classes across or a v4 using this: https://learn.microsoft.com/en-us/azure/azure-functions/functions-dotnet-dependency-injection and move files accross

  • I have updated in the csproj file and still no luck, tried restarting the Azure function multiple times as well. Also tried updating the package and still getting this error. – Coder3000 Sep 06 '22 at 13:42