Bug 6187 - Using WebGetAttribute on inherited wcf operations causes ArgumentException in mono-2.10.9
Summary: Using WebGetAttribute on inherited wcf operations causes ArgumentException in...
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies (show other bugs)
Version: 2.10.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Martin Baulig
URL:
Depends on:
Blocks:
 
Reported: 2012-07-19 05:56 UTC by Simon Svensson
Modified: 2012-09-17 23:24 UTC (History)
3 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


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

Description Simon Svensson 2012-07-19 05:56:48 UTC
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 UTC
Created attachment 2225 [details]
Stack trace.
Comment 2 Simon Svensson 2012-07-19 06:01:09 UTC
Created attachment 2226 [details]
Test case.

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

Notice (2018-05-21): bugzilla.xamarin.com will be switching to read-only mode on Thursday, 2018-05-25 22:00 UTC.

Please join us on Visual Studio Developer Community and GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs and copy them to the new locations as needed for follow-up. The See Also field on each Bugzilla bug will be updated with a link to its new location when applicable.

After Bugzilla is read-only, if you have new information to add for a bug that does not yet have a matching issue on Developer Community or GitHub, you can create a follow-up issue in the new location. Copy and paste the title and description from this bug, and then add your new details. You can get a pre-formatted version of the title and description here:

In special cases you might also want the comments:

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

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