Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest mongoDB Driver 2.0 #7

Open
matthiasjost opened this issue Apr 3, 2015 · 4 comments
Open

Latest mongoDB Driver 2.0 #7

matthiasjost opened this issue Apr 3, 2015 · 4 comments

Comments

@matthiasjost
Copy link

nLog does not work when I upgrade my project to the latest mongoDB Driver:

---> 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)

@matthiasjost
Copy link
Author

Is it possible to have the web application project itself with a newer driver than the one your Target depends on?

@cccsdh
Copy link

cccsdh commented May 7, 2015

The issue is that the new Mongodb driver is a major update with breaking changes. Anything based on the old driver is going to be broken when upgrading to the new driver. You might check out the nuget package: https://www.nuget.org/packages/NLog.MongoDB20/, which is a port of https://github.com/Logrythmik/NLog.MongoDB to utilize the new MongoDB driver 2.0 api.

@matthiasjost
Copy link
Author

Thank you. For me it looks like there are not many contributions in this project. We are going to use Serilog with their offical mongoDB target.

@snakefoot
Copy link
Contributor

@pwelter34 Looks resolved, as this project is now using MongoDB.Driver ver. 2.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants