How to fix assembly binding error in .Net core for multiple versions of same nuget package


I have a .Net Core 2.1 App. The 'Microsoft.AspNetCore.App' package here uses the '2.1.0' version of 'Microsoft.Extensions.DependencyInjection' package. I want to download another third party package which requires the '3.1.0' version of the same 'Microsoft.Extensions.DependencyInjection' package. I have tried to fix this by directly downloading the '3.1.0' version of the package. After doing this, the application builds correctly. But when I try to start the app, I get an error. The event viewer has the following error

Exception Info: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Is there a way to fix this error?

asked on Stack Overflow Dec 19, 2019 by krishnaprasad parthasarathy • edited Dec 19, 2019 by theduck

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0