0
當我在我的項目升級到最新的MongoDB驅動n日誌不起作用:NLog.Mongo和最新的MongoDB C#驅動程序不能正常工作
---> System.TypeInitializationException: The type initializer for 'NLog.Mongo.MongoTarget' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'MongoDB.Driver, Version=1.9.2.235, Culture=neutral, PublicKeyToken=f686731cfb9cc103' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at NLog.Mongo.MongoTarget..cctor()
--- End of inner exception stack trace ---
at NLog.Mongo.MongoTarget..ctor()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
at NLog.Internal.FactoryHelper.CreateInstance(Type t)
它記錄什麼。我正在爲nLog使用mongoDB目標。我已經發布了一個問題(https://github.com/loresoft/NLog.Mongo/issues/7)。但也許有一種方法可以自行解決。
有什麼建議嗎?
該目標與1.9以前的官方mongoDB驅動程序版本一起使用。
這是在web.config中手動執行,這可以通過GUI – Matthias
Web.config進行做....... –