【发布时间】:2022-08-23 04:42:13
【问题描述】:
在使用启用了身份验证的新部署的 MongoDB 容器设置我的新环境时,我遇到了这个异常:\"An unhandled exception has occurred while executing the request. MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> System.NotSupportedException: Unable to create an authenticator.\"
在我的情况下,我正在使用像这个例子这样的连接字符串:mongodb://USER:PASSWORD@HOST:27017/?authMechanism=DEFAULT。该字符串在 MongoDB Compass 中运行良好,但在我的 .NET 6.0 应用程序中却没有。
标签: c# mongodb mongodb-.net-driver