Error System.IO.FileLoadException: 'Could not load file or assembly 'log4net, Version=2.0.8.0 in .NET Core

0

I am doing migration my old .NET 4.5.2 console application to .NET Core, all the code is getting compile successfully but while executing console application I am getting following error

System.IO.FileLoadException: 'Could not load file or assembly 'log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'

In my console application there are few third party dlls along with our internal dlls are referenced which are build on .NET 4.5.2 framework.

Even problem is that before enter my project debug mode, this error has been thrown out due to this I am unable to debug code to find that which assembly is causing this issue.

Do I need to migrate my all internal dlls as well as third party dlls into .NET core which are referenced into my console application?

I know there are many question has been asked for this problem, but these questions are related to .NET framework 4.5.* but I didn't get any solution for migration existing .NET 4.5.2 to .NET Core

c#
.net
.net-core
log4net
asked on Stack Overflow Mar 14, 2019 by M005

1 Answer

0

Finally I got an issue. The problem was that log4net.dll was not getting copied from this location (i.e. C:\Users\User.nuget\packages\log4net\2.0.8\lib\netstandard1.3) to bin/debug folder. I have manually copied this file and it started working.

Now I need to see why this file was not getting copied.

answered on Stack Overflow Mar 14, 2019 by M005

User contributions licensed under CC BY-SA 3.0