Azure Functions throws startup exception - A host error has occurred during startup operation

Viewed 2959

I have Azure Function developed on .NET Core 2.2, which was working fine, later I upgraded it to .NET Core 3.1 it was working all fine.

Recently I upgraded my Microsoft Visual Studio Enterprise 2019 to Version 16.6.2, since then all my Azure functions are failing to run on my local, with exception

System.Private.CoreLib: Could not load file or assembly 'Microsoft.AspNetCore.Mvc.Abstractions, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified. System.Private.CoreLib: Could not load the specified file.

Startup up verbose

Azure Functions Core Tools (2.7.2508 Commit hash: 4da36643c32783a832094318afcd679fa9d76455) Function Runtime Version: 2.0.13351.0 AZURE_FUNCTIONS_ENVIRONMENT: Development

I found similar issues faced by others but the comments over there seems like when Microsoft.NET.Sdk.Functions was in BETA stage, I am using Microsoft.NET.Sdk.Functions v3.0.7 (apparently stable version)

Any suggestion is appreciated.

1 Answers

With .NET 6 and functions v4 also had the same problem, fixed by uninstalling both .NET 6 and Azure Function Core Tools and Reinstalling them Again.

Issue: enter image description here

Resolved: enter image description here

Related