Reputation: 4731
In my Azure function, I'm having issues after upgrading from.NET Core 3.1 to.NET Core 7.0.
System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.Extensions.Http, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.'
All of my nuget packages have been updated to the most recent version, but I still don't understand why this keeps happening. What is the problem?
Upvotes: 1
Views: 1547
Reputation:
In my Azure function, I'm having issues after upgrading from.NET Core 3.1 to.NET Core 7.0
.NET 7.0 In-Process is not yet released for the Azure Functions as mentioned in this MS Doc of Azure Functions - .NET Supported Versions.
Also, in .csproj
file, you have written the Target Framework as Net7.0
to the v3
Azure Functions Version which is incorrect.
Azure Functions Core Tools Version 3 Supports only 3.1 in .NET and v4 supports .NET 6, 7 and Framework 4.8 as stated in this MS Doc.
Also, Microsoft recommends migrating the .NET 3.1 v3 Azure Functions Project to the .NET 6 In-Process for good workflow as you can see in below official screenshot:
Refer to this MS Doc and Nicksnettravels article for more information on migration steps of .NET 3.1 to Higher Versions to make sure your code is compatible.
Upgrade your function Code from .NET 3.1 to the supported Versions such as .NET 6 (In-process, Isolated Process) and .NET 7 Isolated process for the good compatibility code workflow.
Upvotes: 3