karishmal / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
Apache License 2.0
0 stars 0 forks source link

Exception adding multiple instances of a repeatable parameter to HttpWebRequestBuilder. #211

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the sample for Google translate (Translate.TranslateText.csproj)

What is the expected output? What do you see instead?
I expect to see the translation of the text entered.
Instead I see the error:
"An item with the same key has already been added."

This error is generated because it tries to Add twice the parameter "Q" to a 
Dictionary.

What version of the product are you using? On what operating system?
The latest:
google-api-dotnet-client: 20120504-1.2.4507-beta
Mercurial version of the sample: a19014bb1e48

Please provide any additional information below.

Without this functionality this library is useless. So please put the highest 
priority to this issue.

Original issue reported on code.google.com by dome...@googlemail.com on 16 May 2012 at 8:21

GoogleCodeExporter commented 9 years ago
Could you provide the entire stack trace if possible?

Original comment by asky...@google.com on 16 May 2012 at 8:34

GoogleCodeExporter commented 9 years ago
Stack trace:
 System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Google.Apis.Requests.Request.BuildRequest() in c:\googlecode\google-api-dotnet-client\5-4-2012\default\Src\GoogleApis\Apis\Requests\Request.cs:line 597
   at Google.Apis.Requests.Request.CreateWebRequest(Action`1 onRequestReady) in
c:\googlecode\google-api-dotnet-client\5-4-2012\default\Src\GoogleApis\Apis\Requ
ests\Request.cs:line 667
   at Google.Apis.Requests.Request.ExecuteRequestAsync(Action`1 responseHandler)
 in c:\googlecode\google-api-dotnet-client\5-4-2012\default\Src\GoogleApis\Apis\Requests\Request.cs:line 435
   at Google.Apis.Requests.ServiceRequest`1.GetAsyncResponse(Action`1 responseHandler) in c:\googlecode\google-api-dotnet-client\5-4-2012\default\Src\GoogleApis
\Apis\Requests\ServiceRequest.cs:line 162
   at Google.Apis.Requests.ServiceRequest`1.GetResponse() in c:\googlecode\google-api-dotnet-client\5-4-2012\default\Src\GoogleApis\Apis\Requests\ServiceRequest
.cs:line 182
   at Google.Apis.Requests.ServiceRequest`1.Fetch() in c:\googlecode\google-api-dotnet-client\5-4-2012\default\Src\GoogleApis\Apis\Requests\ServiceRequest.cs:li
ne 203
   at Translate.TranslateText.Program.Main(String[] args) in D:\Documents\Code\google-api-examples\Translate.TranslateText\Program.cs:line 62

Original comment by dome...@googlemail.com on 17 May 2012 at 9:17

GoogleCodeExporter commented 9 years ago

Original comment by asky...@google.com on 17 May 2012 at 3:50

GoogleCodeExporter commented 9 years ago

Original comment by asky...@google.com on 17 May 2012 at 5:41

GoogleCodeExporter commented 9 years ago
Fixed in CL
http://code.google.com/p/google-api-dotnet-client/source/detail?r=097b1662b7ee50
f7f165e1c7e5858711411ca624
http://codereview.appspot.com/6210068/

Original comment by asky...@google.com on 21 May 2012 at 5:34

GoogleCodeExporter commented 9 years ago
thank you! it all works fine now.

Original comment by dome...@googlemail.com on 24 May 2012 at 9:58