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=7.0.0.0, 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
Microsoft.Extensions.DependencyInjection
Microsoft.Extensions.DependencyInjection.Abstractions
Microsoft.Extensions.Logging
Microsoft.Extensions.Logging.Abstractions
Microsoft.Extensions.Http
The problem occurs whith the following combination
System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Extensions.DependencyInjection.Abstractions, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60’ or one of its dependencies.
Having referenced 3.1.3.0 previously for the class libraries, it now has been downgraded to 3.1.0.0 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.