我們不斷收到在n層模式下運行wpf應用程序的錯誤。
我們必須建立在http://localhost:8080/TestEntityService
一個vistual目錄我們正在使用Visual Studio模板WPF的n層應用程序,但只要我們想連接到服務器層,我們收到一些weard錯誤。
我們可以瀏覽到服務使用Internet Explorer:http://localhost:8080/TestEntityService/EntityServer.svc
但我們的WPF客戶端總是拋出一個非常weard例外:
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]'
我們不斷收到在n層模式下運行wpf應用程序的錯誤。 我們爲wpf-ntier應用程序使用visual studio模板,但只要我們想連接到服務器層,就會收到一些weard錯誤。 我們在http:// localhost:8080/TestEntityService上設置了一個vistual目錄 – Pascalsz