-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not load file or assembly Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0 #3694
Comments
I am having similar issues, ihave explored same possible solutions and I am still stucked. it seems |
Dupe of Azure/azure-functions-host#6893 TLDR; The functions host runs on ~3.1 and will host your app in-process dynamically. What this means is that if the functions host uses 3.1 of DependencyInjection.Abstractions, it will not be able to load 5.0 of the dll in-process for your app, and your app will fail to run. |
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes. See our Issue Management Policies for more information. |
To run my Azure Function project locally, I resolved missing assembly Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0 runtime error by referencing the old versions of all its dependent DLLs and by including multiple old versions of this assembly. However, I received errors from GitHub Workflow CI/CD when attempting deployment to Azure.
To deploy my Azure Function App, I resolved the NU1605 errors by including in the project file old versions of packages dependent on a common version of the original missing assembly, Microsoft.Extensions.DependencyInjection.Abstractions, and I specifically included the common older versions, 3.1.7 and 3.1.2.
|
In my azure function app project, I receive an assembly not found runtime error Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0. However, the assembly is included in multiple packages I installed from NuGet.
Visual Studio: 2019
Target Framework: netcoreapp3.1
Azure Functions Version: v3
Installed packages containing Microsoft.Extensions.DependencyInjection.Abstractions (5.0.0):
Microsoft.Extensions.Http (5.0.0)
Microsoft.Extensions.Logging (5.0.0)
Microsoft.Extensions.Logging.EventSource (5.0.0)
Error:
A host error has occurred during startup operation...
Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
Ineffective fix attempts:
Installed Microsoft.Extensions.DependencyInjection.Abstractions (5.0.0) from Nuget, but error persists.
Following a similar issue, #2931, and StackOverflow question, I added to the project file the following.
<PropertyGroup> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType> </PropertyGroup>
I also followed an article suggestion. After installing Microsoft.Azure.Functions.Extensions, the error persists.
I also followed another suggestion, and I added the following to my project file. However, the error persists.
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="5.0.0.0" newVersion="5.0.0" /> </dependentAssembly> </assemblyBinding> </runtime>
20201120
I attempted the workaround suggested in issue #401 of ASP.NET Core Announcements: reference the package for the assembly which is failing to load explicitly in my application. However, the error remains.
Using ILSpy, I found Microsoft.Azure.Functions.Extensions, which I installed from NuGet, references Microsoft.Extensions.DependencyInjection.Abstractions, Version 2.1.0.0.
20201123
I found a related StackOverflow question, which links to issue Azure/azure-functions-vs-build-sdk #472 and finally to issue Azure/azure-functions-host #6893. @AartBluestoke summarized: "this can only be solved by upgrading azure functions to a newer version which has a dependency on the 5.x line of the abstractions."
The text was updated successfully, but these errors were encountered: