System.IO.FileNotFoundException when trying to use any existing .net framework 3.5 or 4.0 library in .net Standard 2,0 project

I have a third party DLL that targets .net framework 3.5 and 4.0. But I want to use it to my existing project that targets .net standard 2.0.

When I tried using the library the error that comes up is System.IO.FileNotFoundException: 'Could not load file or assembly 'assemblyName, Version=XXXXX, Culture=neutral, PublicKeyToken=XXXXXXXX'. The system cannot find the file specified.' However the path is correct and all other library that the original library depend upon are already there. Also, when I use the library from the same location in a sample .net framework project with the same .net target version. That project works fine.

Does anyone has any idea on how to achieve this if possible?

1 answer

  • answered 2020-03-31 14:21 alby98

    you should try changing the library version from the nuget package manager. by right clicking on the project and going to 'manage nuget packages'. There you can search for your library and specify which version to use and then compile