Little issue with ServiceStack.Authentication.MongoDb

I am migrating / modifying some of my source code which origins 11 years ago (ServiceStack version 4.0). At that time I have implemented my own version of IUserAuthRepository with a MongoDB version. Now its time to move to the ‘official’ version.

Unfortunately I get some version conflicts with my driver. ServiceStack.Authentication.MongoDb 8.9.0 depends on MongoDB.Driver 2.30.x which is pretty outdated, I use Version 3.5 to work with my server side.

The issues I have is with type conflicts, e.g. Collation exists in both MongoDB.Driver.Core 2.30 and `MongoDB.Driver 3.5. Unfortunately I cannot downgrade, since my server is latest version and does require a 3.x driver version.

Do you have a workaround for me or would it be possible to use a more recent MongoDB driver in your library?

Thanks a lot for your help.

The way to get around dependency issues is to use a local copy of the source code where it will use whatever version your App does. It’s only 2 files:

On closer inspection MongoDB.Driver.Core is no longer needed, which is now removed from the latest just released ServiceStack v8.10. So you should now be able to upgrade to resolve the issue.

Hi Demis, great, excellent service as always! Thanks very much.

1 Like