We have an issue where we have a library that we've had to create in .NET Standard 2.0, but our unit tests run in .NET 4.7.1
Although the two frameworks are compatible, SpirePdf.Net throws an error due to a semantic versioning error between the two versions of the DLL in the NuGet Package.
I can confirm the problem exists in FreeSpire.Pdf versions 5.10.0 and 5.4.0
Your DLLs in the lib folder are actually showing different versions, which confuses .NET and requires Version Redirects to be used in the projects:
- net20 - 5.10.5.20020
- net40 - 5.10.5.20040
- net46 - 5.10.5.20046
- netcoreapp2.0 - 5.10.5.20420
- netstandard2.0 - 5.10.5.20320
As per Microsoft's documentation, you should try to keep the Assembly Version the same, but the Assembly File Version can differ so that you can tell your DLLs apart.
This would mean that all your DLLs would have an AssemblyVersion of 5.10.5.0 but your AssemblyFileVersion could be set to contain the last digits as above.
Doing this will save any others multi-targetting a massive headache!
Thanks!
Stuart