I’ve been getting this error message when I try to run my Azure function v4.
System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.Extensions.Options, Version=22.214.171.124, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.'
This used to work like a week ago, and now it’s throwing this error at runtime. Latest changes I did was to update EF Core to version 7. But I guess that’s not relevant because that’s in a different project, so not related to the function project.
These are the package references in my function project:
Has anyone else got it or any idea how to resolve it?
Tried removing all the Nuget packages and installing them. That didn’t work. I can see the Microsoft.Extensions.Options.dll (v7) in the debug folder as well. Not sure why the runtime complains about it.
I recently updated to VS 2022 Version 17.4.1. Maybe that’s the issue here?
I can see that you have closed this thread but the problem still remains in a scenario where I cannot see that it has been addressed above. I’ve also followed issue #3213 (please do correct me here if I missed the proposed solution for this).
What is the recommendation for solving the following scenario which generates very much the same type of issue:
net standard 2.0 class libraries where the following dlls are referenced directly or indirectly
The problem occurs whith the following combination
System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Extensions.DependencyInjection.Abstractions, Version=126.96.36.199, Culture=neutral, PublicKeyToken=adb9793829ddae60’ or one of its dependencies.
Having referenced 188.8.131.52 previously for the class libraries, it now has been downgraded to 184.108.40.206 to make this work. This workaound prevent currently to upgrade libraries to latest and greatest version keeping up with improvements and possibly new features.
.net core related project, as of my understanding, will automatically be able to reference higher versions wihout a need for bindingRedirect whereas using .net framework bindingRedirect would be needed. Here we have a 3rd party application in Python loading these class libraries and having the version problem on Microsoft.Extensions.DependencyInjection.Abstractions.