Tips and Tricks in a world of Mix

When your code is executing in the Visual Studio integrated development environment (IDE), you can avoid the exception dialog box that appears for specific MDA events. To do that, on the Debug menu, click Exceptions. (If the Debug menu does not contain an Exceptions command, click Customize on the Tools menu to add it.) In the Exceptions dialog box, expand the Managed Debugging Assistants list, and then clear the Thrown check box for the individual MDA. For example, to avoid the exception dialog box for a contextSwitchDeadlock MDA clear the Thrown check box next to its name in the Managed Debugging Assistants list. You can also use this dialog box to enable MDAs.

So if you are getting something like this – PinvokeStackImbalance when you are using some invoke – such as
MethodInfo mi = rs.GetType().GetMethod(“YourUmanagedFunction”,
new Type[] { typeof(int), typeof(string), typeof(StringBuilder) });
mi = mi.MakeGenericMethod(typeof(TEntity));

//TODO: Implement List
results = (TEntity)mi.Invoke(rs, new object[] { 110, this.Path, query });

You should unmark it in the Debug-> Exceptions -> Managed Debugging Assistants :

That should solve the problem!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Tag Cloud

%d bloggers like this: