This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 6187 - Using WebGetAttribute on inherited wcf operations causes ArgumentException in mono-2.10.9
: Using WebGetAttribute on inherited wcf operations causes ArgumentException in...
Status: RESOLVED FIXED
Product: Class Libraries
Classification: Mono
Component: WCF
: 2.10.x
: Macintosh Mac OS
: --- normal
: ---
Assigned To: Martin Baulig
:
:
:
:
  Show dependency treegraph
 
Reported: 2012-07-19 05:56 EDT by Simon Svensson
Modified: 2012-09-17 23:24 EDT (History)
3 users (show)

See Also:
Tags:
Test Case URL:
External Submit: ---


Attachments
Test case. (1.30 KB, application/octet-stream)
2012-07-19 05:56 EDT, Simon Svensson
Details
Stack trace. (4.33 KB, text/plain)
2012-07-19 05:57 EDT, Simon Svensson
Details
Test case. (1.30 KB, text/plain)
2012-07-19 06:01 EDT, Simon Svensson
Details

Description Simon Svensson 2012-07-19 05:56:48 EDT
Created attachment 2224 [details]
Test case.

I'm attempting to get a working MS.NET application under mono-2.10.9. I get an
ArgumentException (An element with the same key already exists in the
dictionary) for all services whose service contract inherits another service
contract, and the inherited contract has operations annotated with [WebGet].

I've attached a test case.

Stack trace:
System.ArgumentException: An element with the same key already exists in the
dictionary.
  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.9/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.9/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.9/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) [0x004a5] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescriptionGenerator.cs:346
  at
System.ServiceModel.Description.ContractDescriptionGenerator.FillOperationsForInterface
(System.ServiceModel.Description.ContractDescription cd, System.Type
exactContractType, System.Type givenServiceType, Boolean isCallback) [0x00125]
in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/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) [0x001d5] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/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.9/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.9/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescriptionGenerator.cs:131
  at System.ServiceModel.ServiceHost.GetServiceContractDescriptions ()
[0x0002b] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel/ServiceHost.cs:138
  at System.ServiceModel.ServiceHost.CreateDescription (IDictionary`2&
implementedContracts) [0x00013] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel/ServiceHost.cs:117
  at System.ServiceModel.ServiceHostBase.InitializeDescription
(System.ServiceModel.UriSchemeKeyedCollection baseAddresses) [0x00007] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel/ServiceHostBase.cs:437
  at System.ServiceModel.ServiceHost.InitializeDescription (System.Type
serviceType, System.ServiceModel.UriSchemeKeyedCollection baseAddresses)
[0x0001d] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel/ServiceHost.cs:155
  at System.ServiceModel.ServiceHost.InitializeDescription (System.Object
serviceInstance, System.ServiceModel.UriSchemeKeyedCollection baseAddresses)
[0x00007] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel/ServiceHost.cs:161
  at System.ServiceModel.ServiceHost..ctor (System.Object serviceInstance,
System.Uri[] baseAddresses) [0x00017] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel/ServiceHost.cs:53
  at ConsoleApplication.MainClass.Main (System.String[] args) [0x00006] in
/Users/sisve/Documents/Dev/ConsoleApplication/ConsoleApplication/Main.cs:9
Comment 1 Simon Svensson 2012-07-19 05:57:55 EDT
Created attachment 2225 [details]
Stack trace.
Comment 2 Simon Svensson 2012-07-19 06:01:09 EDT
Created attachment 2226 [details]
Test case.

Previous test case with correct content type.
Comment 3 Simon Svensson 2012-09-06 04:14:38 EDT
Issue also exists in Mono 2.11.3
Comment 4 Martin Baulig 2012-09-17 23:23:14 EDT
Fixed; master commit 7c68dee, mono-2-10 9983d67.

Note You need to log in before you can comment on or make changes to this bug.