草庐IT

GetServer

全部标签

c# - 'MongoDB.Driver.MongoClient' 不包含 'GetServer' 的定义 ...可以找到类型为 'MongoDB.Driver.MongoClient' 的第一个参数

我正在尝试熟悉从C#程序写入MongoDB。我已经按照http://mongodb.github.io/mongo-csharp-driver/1.11/getting_started/的建议设置了我的代码我正在尝试运行该程序,但出现此错误“‘MongoDB.Driver.MongoClient’不包含‘GetServer’的定义,并且没有扩展方法‘GetServer’接受‘MongoDB.Driver’类型的第一个参数。可以找到MongoClient”。我可以得到一些帮助吗?提前致谢,田.usingSystem;usingSystem.Collections.Generic;usin

c# - StackExchange.ConnectionMultiplexer.GetServer 不工作

using(ConnectionMultiplexerconnection=ConnectionMultiplexer.Connect("redisIP:6379,allowAdmin=true")){Model.SessionInstances=connection.GetEndPoints().Select(endpoint=>{varstatus=newStatus();varserver=connection.GetServer(endpoint);//Exceptionthrownhere!status.IsOnline=server.IsConnected;returnst

C# MongoDB.Driver GetServer 不见了,现在怎么办?

来自mongoDB.Driver文档(http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-csharp-driver/)GetaReferencetoaServerObjectTogetareferencetoaserverobjectfromtheclientobject,writethis:varserver=client.GetServer();在最新版本中,GetServer方法已经消失了,但是文档还没有更新,我们现在用什么?感谢您的宝贵时间。 最佳答案