How to use net standard 2.0 with dependency in net framework 4.7.2?

0

I'm working on a net standard library that will be used by two projects (one in net core 2.2, the other in net framework 4.7.2). When I run thye code, I got this error :

System.IO.FileLoadException
 HResult=0x80131040
 Message=Impossible de charger le fichier ou l'assembly 'Microsoft.Extensions.Logging.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' ou une de ses dépendances. La définition trouvée du manifeste de l'assembly ne correspond pas à la référence de l'assembly. (Exception de HRESULT : 0x80131040)
 Source=IfcReader.Library
 StackTrace:
  at IfcReader.Library.ReaderHelper.Read(String token, FileInfo ifcFile, BimFluxModel model) in C:\Users\T.GALLAND\Documents\Dev\Repos\BIMFlux - IFCReader\IfcReader.Library\ReaderHelper.cs:line 92
  at IfcReaderTest.Read.Test1() in C:\Users\T.GALLAND\Documents\Dev\Repos\BIMFlux - IFCReader\IfcReaderTest\Read.cs:line 24

Inner Exception 1:
FileLoadException: Impossible de charger le fichier ou l'assembly 'Microsoft.Extensions.Logging.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' ou une de ses dépendances. La définition trouvée du manifeste de l'assembly ne correspond pas à la référence de l'assembly. (Exception de HRESULT : 0x80131040)

I moved all my project to "PackageReference", tried to put

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

When I build or try UnitTest, all the dll (includding Microsoft.Extensions.Logging.Abstractions) are present.

How could I solved this error ?

c#
.net
.net-standard
asked on Stack Overflow May 2, 2019 by Thibaud

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0