c# Unable to connect to a member of the replica set matching the read preference
Unable to connect to a member of the replica set matching the read preference Primary: 未将对象引用设置到对象的实例。.]
MongoDB.Driver.Internal.MultipleInstanceMongoServerProxy.ThrowConnectionException(ReadPreference readPreference) +535
MongoDB.Driver.Internal.MultipleInstanceMongoServerProxy.Connect(TimeSpan timeout, ReadPreference readPreference) +677
MongoDB.Driver.Internal.MultipleInstanceMongoServerProxy.ChooseServerInstance(ReadPreference readPreference) +182
MongoDB.Driver.Internal.DiscoveringMongoServerProxy.ChooseServerInstance(ReadPreference readPreference) +110
MongoDB.Driver.MongoServer.AcquireConnection(MongoDatabase database, ReadPreference readPreference) +367
MongoDB.Driver.MongoCursorEnumerator`1.AcquireConnection() +108
MongoDB.Driver.MongoCursorEnumerator`1.GetFirst() +80
MongoDB.Driver.MongoCursorEnumerator`1.MoveNext() +203
System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +121
MongoDB.Driver.MongoCollection.FindOneAs(IMongoQuery query) +176
MongoDB.Driver.MongoCollection.RunCommandAs(Type commandResultType, IMongoCommand command) +123
MongoDB.Driver.MongoDatabase.RunCommandAs(Type commandResultType, IMongoCommand command) +64
MongoDB.Driver.MongoDatabase.RunCommandAs(IMongoCommand command) +120
MongoDB.Driver.MongoDatabase.RunCommand(IMongoCommand command) +60
MongoDB.Driver.MongoCursor.Size() +374
MongoDB.Driver.Linq.SelectQuery.<TranslateCount>b__2(IEnumerable source) +65
MongoDB.Driver.Linq.SelectQuery.Execute() +2385
MongoDB.Driver.Linq.MongoQueryProvider.Execute(Expression expression) +132
MongoDB.Driver.Linq.MongoQueryProvider.Execute(Expression expression) +227
System.Linq.Queryable.Count(IQueryable`1 source) +196
Webdiyer.WebControls.Mvc.PageLinqExtensions.ToPagedList(IQueryable`1 allItems, Int32 pageIndex, Int32 pageSize) +248
WindInfoSys.Code.BLL.ManageTargetService.tuijian(Int32 page, Int32 maxPage) in D:\ZyhMyData\CompanyTask\2016\11\Mongodb--WinSysInfo\WindInfoSys_Mongo_Lastest\Web_Code\Code\BLL\BaseService.cs:801
WindInfoSys.Controllers.BaseController.Important() in D:\ZyhMyData\CompanyTask\2016\11\Mongodb--WinSysInfo\WindInfoSys_Mongo_Lastest\Web_Code\Controllers\BaseController.cs:1896
lambda_method(Closure , ControllerBase , Object[] ) +101
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +59
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +435
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +60
System.Web.Mvc.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a() +145
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +433
System.Web.Mvc.<>c__DisplayClassf.<InvokeActionMethodWithFilters>b__c() +72
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +323
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +844
System.Web.Mvc.Controller.ExecuteCore() +130
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +123
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +39
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__4() +68
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +41
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +39
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +137
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +56
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +37
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +63
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9644037
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155