Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
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.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Given the following code...
Dictionary<string, object> dict = new Dictionary<string, object> ();
string key = "id";
long val = 123456;
dict[key] = val;
If I "watch" the dict var, after assignment dict shows "Incorrect number or types of arguments" in the "Watch" panel. However, if I do...
long test = (long)dict[key];
then it properly sets "test" to 123456 as long. So, the value is there, it just seems to be an issue when viewing it in the "Watch" panel.
I'm using Xamarin Studio 4.0.8 build 2.
Are you sure that you meant "dict"? Because the key has to be a string...
if I add "dict[key]" to the watch window, it correctly shows me "123456" and says the type is "long"
You are correct...watching "dict[key]" works. I wasn't clear. I'm watching "dict" and just expanding the item to see it's collection. To show you, I also added a second KVP of "id2" with a string value of "some string". In the screenshot linked below, you can see that expanding the "dict" var doesn't show the item at "0" that is a long, but will show the "id2" item at "1" that is a string. Shouldn't it be consistent and show something at "0" as well instead of the error message?
thanks for the clarification, I'll look into this
We're calling .ToString() with no arguments on a KeyValuePair`2 and the runtime is throwing an InvalidArgumentException. Not sure why...
Zoltan: any idea why this fails if the value is a long but works for other types?
Is the exception thrown by the sdb code, or by the application ? In the former case, could you obtain a stacktrace from xs ?
Fixed in master 7c89014866fd7d162336970a78a89c9f0ffd7a4d.