I'm currently setting up a client server project. My server part is a C# WebAPI project (net45). My client part is a C# WPF project (net45).
For logging I want to use Common.Logging with the Common.Logging.NLog32 adapter.
At first I configured it in the server part and it worked like a charm. I went on configuring it for the WPF application and it keeps failing when calling:
LogManager.GetCurrentClassLogger();
Or
LogManager.GetLogger("MyLogger");
The exception tells me that it was unable to create an instance of Common.Logging.NLog.NLogLoggerFactoryAdapter
. The inner exception reveals that it can´t find the NLog assembly in version 3.2.0.0 with the PublicKeyToken of 5120e14c03d0593c.
In both cases, server and client, I installed the very same nuget packages. While the server part has no problem using the NLog 3.2.1.0 assembly (came along with Common.Logging.NLog32) the client continues to fail loading it.
Any ideas why the behaviour differ and how to get around this issue without manually loading the exact NLog version?