question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stop throwing first chance exceptions when CreateInstance is called on generic extension point types

See original GitHub issue

Very much like #494, only with open generic types. When we try to instantiate argument formatters, fake configurators, and dummy factories, we may try to instantiate an open generic type, causing a first chance exception.

For an example, see Configure_should_be_null_guarded. We try to instantiate TestableConfigurator<T>.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
adamralphcommented, Sep 2, 2016

bothering people who break on first chance exceptions

Then they shouldn’t break on first chance exceptions. As I said above, there are many libraries out there which raise first chance exceptions during regular execution.

slowing things down

Yes, that’s a valid reason to change this behaviour.

On that basis, I’m changing this to an enhancement.

1reaction
blairconradcommented, Sep 2, 2016

I suppose it depends on what we think a “bug” is.

The symptom this issue was intended to correct is unintended behaviour, which I’d argue is undesirable.

Any exception that’s thrown will cause the runtime to fire up some exception-handling mechanisms which could have a number of unwanted effects, such as bothering people who break on first chance exceptions, or just slowing things down.

If we want to say that removing the unintended undesirable behaviour that may bother the user is closer to a performance improvement (and thus enhancement) than a bug, I’m happy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Avoiding first chance exception messages when the ...
To avoid seeing the messages, right-click on the output window and uncheck "Exception Messages". However, seeing them happen might be nice, ...
Read more >
Alternative To Generic Methods where Type is known at ...
I'm trying to follow some of the patterns/conventions that Dapper uses, in particular Dapper.Contrib.Extensions and how the use reflection on ...
Read more >
Understanding Exceptions while debugging with Visual ...
Configuring the debugger to break for first chance exceptions To change when the debugger breaks, go to Debug->Windows->Exception Settings.
Read more >
IronPython .NET Integration
NET supports generic types which allow the same code to support multiple type ... This allows Python exception thrown from Python code to...
Read more >
Core Technologies
You cannot merge different collection types (such as a Map and a List). If you do attempt to do so, an appropriate Exception...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found