Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TargetParameterCountException when try to send message containing List<string> property. #22

Open
ChrisNeedSpace opened this issue Aug 20, 2014 · 3 comments
Labels

Comments

@ChrisNeedSpace
Copy link

Hi!

BUG:
My message contains a List property.
When I choose this message from the messages list in SendMessage window, the TargetParameterCountException exception is thrown.

REASON:
The exception is thrown while updating the property label and List is treated as a complex type and label wants to add all properties of List type, whereas one of them is string[Int32] and is causes an exception in ServiceBusMQ.TypeExtensions,GetAttribValue() when try to:
"p.GetValue(obj, null);"

SOLUTION:
I suggest that you add the following code in ServiceBusMQ.TypeExtensions,GetAttribValue(), line 109:

if (p.GetIndexParameters().Count() > 0)
return "";

@ChrisNeedSpace
Copy link
Author

Additionally, lists are displayed as "List`1" and user does not know the generic type.
It would be nice in the TypeExtensions.GetDisplayName() method to replace the following code:

"return string.Format("{0} ({1})", type.Name, props.ToString());

with:

string genericTypes = string.Join(", ", type.GetGenericArguments().ToList());
if (genericTypes.Length > 0) genericTypes = string.Format("<{0}>", genericTypes);
return string.Format("{0}{1} ({2})", type.Name, genericTypes, props.ToString());

@ChrisNeedSpace
Copy link
Author

Still, after my fix there are errors in other places of the application (with List property): when I click the "right arrow" icon in front of the property:

bug screen

@danielHalan
Copy link
Owner

Could you attach Screenshots & possibly Exceptions on the other Errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants