I have created a .netstandard2.0 and 2.1 library that within that envrioment and unit tests all working fine.
If I compile it into its dll and reference it into a .net framework 4.8 console app and try and use it I get an error such as:
System.IO.FileNotFoundException: 'Could not load file or assembly
In the above example its for Microsoft.Extensions.Caching.Memory, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies
I thought the idea of standard was to create something compatible for all. Or have a missed a step and this error is to be expected?
Uday DodiyaPosted Oct 7, 2022, 4:36 AM
Most likely it fails to load another dependency.
you could try to check the dependencies with a dependency walker.
I.e: https://www.dependencywalker.com/
Also check your build configuration (x86 / 64)
Edit: I also had this problem once when I was copying dlls in zip from a "untrusted" network share. The file was locked by Windows and the FileNotFoundException was raised.
Rajanikant HawaldarPosted Oct 1, 2022, 12:45 PM
Microsoft.Extensions.Caching.Memory same version of dll should be referenced in your project and class libraries, if any of the solutions which referenced to your project have different version then you will get this error.