我们不断收到以 n 层模式运行 wpf 应用程序的错误。
我们在http://localhost:8080/TestEntityService设置了一个可视目录
我们正在为 wpf-ntier 应用程序使用 Visual Studio 模板,但只要我们想连接到服务器层,就会收到一些磨损的错误。
我们可以使用 Internet Explorer 浏览到该服务:http://localhost:8080/TestEntityService/EntityServer.svc
但是我们的 wpf 客户端总是抛出一个非常糟糕的异常:
Sunrise.Shells.Lisp.vshost.exe Error: 0 : 2017-03-23
10:29:12.6148|ERROR||Sunrise.Modules.Instruments.ViewModels.HostViewModel+<LoadInstruments>d__112 | MoveNext ==> Exception has been thrown by the target of an invocation.
InnerException:
Communications with the service 'EntityServer' using Uri of 'http://localhost:8080/TestEntityService/EntityServer.svc cannot be started. See the internal exception for more information.
InnerException:
Type 'MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders.InsertMessageBinaryEncoder`1+InsertFlags[TDocument]' cannot be exported as a schema type because it is an open generic type. You can only export a generic type if all its generic parameter types are actual types.
StackTrace:
at System.Runtime.Serialization.DataContractSet.EnsureTypeNotGeneric(Type type)
at System.Runtime.Serialization.XsdDataContractExporter.GetSchemaTypeName(Type type)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.ValidateDataContractType(Type type)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter..ctor(OperationDescription description, DataContractFormatAttribute dataContractFormatAttribute, DataContractSerializerOperationBehavior serializerFactory)
at System.ServiceModel.Description.DataContractSerializerOperationBehavior.GetFormatter(OperationDescription operation, Boolean& formatRequest, Boolean& formatReply, Boolean isProxy)
at System.ServiceModel.Description.DataContractSerializerOperationBehavior.System.ServiceModel.Description.IOperationBehavior.ApplyClientBehavior(OperationDescription description, ClientOperation proxy)
at System.ServiceModel.Description.DispatcherBuilder.BindOperations(ContractDescription contract, ClientRuntime proxy, DispatchRuntime dispatch)
at System.ServiceModel.Description.DispatcherBuilder.ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime clientRuntime)
at System.ServiceModel.Description.DispatcherBuilder.BuildProxyBehavior(ServiceEndpoint serviceEndpoint, BindingParameterCollection& parameters)
at System.ServiceModel.Channels.ServiceChannelFactory.BuildChannelFactory(ServiceEndpoint serviceEndpoint, Boolean useActiveAutoClose)
at System.ServiceModel.ChannelFactory.CreateFactory()
at System.ServiceModel.ChannelFactory.OnOpening()
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open()
at System.ServiceModel.ChannelFactory.EnsureOpened()
at System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via)
at System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address)
at IdeaBlade.EntityModel.WcfProxy`1.CreateProxyCore()
服务器没有任何对 mongodb dll 的引用,但客户端无法连接。
Type 'MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders.InsertMessageBinaryEncoder`1+InsertFlags[TDocument]'