2017-03-21 38 views
0

我們希望使用帶有topshelf的實體管理器控制檯以三層模式運行我們的wpf客戶端應用程序,以在本地測試和運行實體服務器。如何部署並將實體服務器作爲控制檯應用程序進行部署並使用topops

我們只能使用提供的Tools ServerConsole.exe找到文檔,但我們想要自己構建控制檯。

是否可以使用控制檯應用程序構建實體服務器並在本地運行它?

文檔http://drc.ideablade.com/devforce-2012/bin/view/Documentation/deploy-console沒有解釋如何在沒有提供ServerConsole.exe的情況下構建控制檯yourselfe。

回答

0

DevForce將舉辦三EntityServer方式(當然,四實際上):

  • 通過ServerConsole.exe經由ServerService.exe控制檯應用程序
  • 作爲Windows服務
  • 通過IIS/ASP.NET
  • 第4個選項不是真正的託管服務,但是無論何時以2層模式運行,都會使用本地進程內EntityServer。

託管選項全部啓動至少兩個WCF服務:EntityServiceHostEntityServerHost。這些是System.ServiceModel.ServiceHost的公共子類型,可在IdeaBlade.EntityModel.Server程序集中找到。我們不提供如何使用這些文件或指導。

如果您可以告訴我更多關於您的要求,也許我可以提供其他選擇。

+0

我們不斷收到在n層模式下運行wpf應用程序的錯誤。 我們爲wpf-ntier應用程序使用visual studio模板,但只要我們想連接到服務器層,就會收到一些weard錯誤。 我們在http:// localhost:8080/TestEntityService上設置了一個vistual目錄 – Pascalsz

0

我們不斷收到在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]' 
+1

由於初始化EntityServer的WCF代理,客戶端上發生此錯誤。在這個初始化過程中,DF會探測「已知類型」,並且它看起來像這個MongoDB程序集中的一個類型正在被拾取。如果類型被您的某個實體類型引用,則可能會發生這種情況,但如果沒有更多信息,則很難說。您可以使用IdeaBlade從初始化探測中排除程序集。Core.Composition.CompositionHost.SearchPatterns.Add( 「someassembly.dll」);請參閱http://drc.ideablade.com/devforce-2012/bin/view/Documentation/discovery#HControllingdiscovery。 –

+1

Hi Kim,從客戶端中剔除了所有的mongodb引用,它正在工作。但是當然,我們仍然需要客戶端上的這個mongodb連接。我將按照文檔來控制組合searchpattern。 – Pascalsz

相關問題