TargetInvocationException – How to break on the correct line


In many modern applications, you use Task or Threads to optimize your code. But when an exception occurred, you receive a generic exception like System.Reflection.TargetInvocationException: ‘Exception has been thrown by the target of an invocation.’

To avoid that in Visual Studio, go to Option / Debugging / General, and check Enable Just My Code. The result will be like that.

Advertisements
Posted in MVVM, Thread, Tips and others

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

Follow me
   RSS Feed    Twitter    Linked In

Write you email address to subscribe at this blog and to receive new posts by mail.

Join 611 other followers

Who I am?






%d bloggers like this: