我正在尝试在单声道3.2.8的ubuntu服务器上运行Nancy,当我启动服务器时它给出了以下错误:
:~/temp$ sudo mono Medusa.WEB.Server.exe
System.InvalidOperationException: ContractDescription 'NancyWcfGenericService' has zero operations; a contract must have at least one operation.
at System.ServiceModel.Description.ServiceEndpoint.Validate () [0x00000] in <filename unknown>:0
at System.ServiceModel.ServiceHostBase.ValidateDescription () [0x00000] in <filename unknown>:0
at System.ServiceModel.ServiceHostBase.InitializeRuntime () [0x00000] in <filename unknown>:0
at System.ServiceModel.ServiceHostBase.OnOpen (TimeSpan timeout) [0x00000] in <filename unknown>:0
at System.ServiceModel.Channels.CommunicationObject.Open (TimeSpan timeout) [0x00000] in <filename unknown>:0
at System.ServiceModel.Channels.CommunicationObject.Open () [0x00000] in <filename unknown>:0
at Medusa.WEB.Server.WcfWebServer.Start () [0x00000] in <filename unknown>:0
当我尝试使用单声道2.10时没有发生此错误,而是在我调用其余的webservice时出现了不同的错误(这是我更新到3.2.8的原因)。此外,服务器在Windows上工作。
答案 0 :(得分:2)
WFC在Mono上并没有真正实现或支持,我很惊讶它实现了这么远。
如果你想在Mono上自我托管,请使用Nancy.Hosting.Self或Nancy.Owin以及像Katana或nowin这样的OWIN自我主持人。