Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Should not swallow unhandled exceptions if debugger is attached. #1202

Closed
MattGal opened this issue Feb 12, 2015 · 2 comments
Closed

Should not swallow unhandled exceptions if debugger is attached. #1202

MattGal opened this issue Feb 12, 2015 · 2 comments
Assignees
Milestone

Comments

@MattGal
Copy link

MattGal commented Feb 12, 2015

As an example, in a traditional desktop app, let’s say I have this:

    static void Main(string[] args)
    {
        int zero = 0;
        try
        {
            int foo = 2 / zero;
        }
        catch { }
        int bar = 2 / zero;

    }

If I turn on 1st chance exceptions and F5, I break on foo, and can continue. If I don’t, it’s caught and I break on bar and cannot continue. Makes sense.

Now, if you try the same thing on a K project with 1st chance exceptions turned on, you see the same thing. If you turn them off and happen to uncheck "Just my code" in debugger settings, when it gets to the bar line it just exits. The exception appears to be swallowed (so is only ever really 1st chance) and then goes away.

When the debugger is attached, as is in this case, it'd be great to just re-throw those exceptions.

@glennc glennc added this to the 1.0.0 milestone Mar 13, 2015
@glennc glennc added the bug label Mar 13, 2015
@muratg muratg modified the milestones: 1.0.0, 1.0.0-beta5 Mar 20, 2015
@davidfowl davidfowl self-assigned this Mar 29, 2015
davidfowl added a commit that referenced this issue Mar 29, 2015
- Allow overriding the console host env var
- This allows VS to set it so that exceptions that occur before
the application runs, throw proper exceptions instead of disappearing
with a quick console window when f5 is hit in VS.
- Added SetConsoleHost to PAL
- Handle unwrapping exceptions in the EntryPointExecutor

#1202 #726
@davidfowl
Copy link
Member

/cc @BillHiebert inorder to throw exceptions on f5, we need to pass a flag on launching for console apps in VS.

@davidfowl
Copy link
Member

Closing this an opening a tooling issue.

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

No branches or pull requests

4 participants