.Net Core looking for a lower version of referenced assembly

34 Views Asked by At

Hi have an external dll in my .net core project that references System.IO.Abstractions 17.2.3

However, when my project tries to load this dll it throws the following error:

Could not load file or assembly 'System.IO.Abstractions, Version=17.0.0.0, Culture=neutral, PublicKeyToken=96bf224d23c43e59'. The system cannot find the file specified.

My projects project.assets.json has no reference to it and neither does the dll's project.assets.json I'm referencing (it's one of our own dlls).

I tried adding this to my csproj of my web app but no joy

<PropertyGroup>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
    <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>

What could be causing it to look for 17.0.0.0 instead of 17.2.3?

1

There are 1 best solutions below

0
ΩmegaMan On

In Nuget make sure to set each package to [get] the latest instead of least version. Some other package may be getting the version that is causing your main code to have this error.