在Mac Os X上的Mono控制台应用程序中托管WCF服务

时间:2012-03-09 09:17:14

标签: wcf mono

当我尝试托管WCF服务时,它在Windows中完美运行,在单声道控制台应用程序中,我收到以下错误(*):

  

字典中已存在具有相同键的元素。

我根本不知道为什么会发生这种情况或者我需要解决这个问题。任何经历过这种情况或者能指出我正确方向的人都会这样做吗?

我在运行Os X 10.6.8的Mac上使用Mono 2.10.8。

*堆栈跟踪:

 at System.Collections.ObjectModel.KeyedCollection`2[System.Type,System.ServiceModel.Description.IOperationBehavior].InsertItem (Int32 index, IOperationBehavior item) [0x0003a] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/corlib/System.Collections.ObjectModel/KeyedCollection.cs:168 
  at System.Collections.Generic.KeyedByTypeCollection`1[System.ServiceModel.Description.IOperationBehavior].InsertItem (Int32 index, IOperationBehavior kind) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/System.ServiceModel/System.Collections.Generic/KeyedByTypeCollection.cs:70 
  at System.Collections.ObjectModel.Collection`1[System.ServiceModel.Description.IOperationBehavior].Add (IOperationBehavior item) [0x0000c] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/corlib/System.Collections.ObjectModel/Collection.cs:74 
  at System.ServiceModel.Description.ContractDescriptionGenerator.GetOrCreateOperation (System.ServiceModel.Description.ContractDescription cd, System.Reflection.MethodInfo mi, System.Reflection.MethodInfo serviceMethod, System.ServiceModel.OperationContractAttribute oca, System.Type asyncReturnType, Boolean isCallback, System.Type givenServiceType) [0x00511] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescriptionGenerator.cs:350 
  at System.ServiceModel.Description.ContractDescriptionGenerator.FillOperationsForInterface (System.ServiceModel.Description.ContractDescription cd, System.Type exactContractType, System.Type givenServiceType, Boolean isCallback) [0x00131] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescriptionGenerator.cs:240 
  at System.ServiceModel.Description.ContractDescriptionGenerator.GetContractInternal (System.Type givenContractType, System.Type givenServiceType, System.Type serviceTypeForCallback) [0x001ed] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescriptionGenerator.cs:190 
  at System.ServiceModel.Description.ContractDescriptionGenerator.GetContract (System.Type givenContractType, System.Type givenServiceType, System.Type serviceTypeForCallback) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescriptionGenerator.cs:136 
  at System.ServiceModel.Description.ContractDescriptionGenerator.GetContract (System.Type givenContractType, System.Type givenServiceType) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescriptionGenerator.cs:131 
  at System.ServiceModel.Description.ContractDescriptionGenerator.GetContract (System.Type contractType) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescriptionGenerator.cs:101 
  at System.ServiceModel.Description.ContractDescription.GetContract (System.Type contractType) [0x00017] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescription.cs:66 
  at System.ServiceModel.ServiceHost.AddServiceEndpoint (System.Type implementedContract, System.ServiceModel.Channels.Binding binding, System.Uri address, System.Uri listenUri) [0x00022] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/System.ServiceModel/System.ServiceModel/ServiceHost.cs:96 
  at System.ServiceModel.ServiceHost.AddServiceEndpoint (System.Type implementedContract, System.ServiceModel.Channels.Binding binding, System.Uri address) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/System.ServiceModel/System.ServiceModel/ServiceHost.cs:85 
  at ConsoleApplication3.Program.Main (System.String[] args) [0x0002b] in /Users/steven/Software/ABC Cloud/NooSphere/Mono.Host/Main.cs:16 

1 个答案:

答案 0 :(得分:1)

这是Mono中的一个错误,已修复mono-2.10.9(仅限Mac更新)和Mono for Android 4.2.7