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

ArgumentNullException (and possibly others) hard crash the debugger (and the application) #2297

Closed
JHorvath-MaxetaTech opened this issue May 14, 2018 · 2 comments

Comments

@JHorvath-MaxetaTech
Copy link

Environment data

.NET Command Line Tools (2.1.200)

Product Information:
Version: 2.1.200
Commit SHA-1 hash: 2edba8d7f1

Runtime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.200\

Microsoft .NET Core Shared Framework Host

Version : 2.0.7
Build : 2d61d0b043915bc948ebf98836fefe9ba942be11

VS Code version: 1.23.1

C# Extension version: 1.15.1

Steps to reproduce

  1. dotnet new webapi

  2. update ValuesController with the following get

    // GET api/values/5
    [HttpGet("{id}")]
    public string Get(int id) {
      String result = null;
      switch (id) {
        case 1:
          throw new Exception("One");
        break;
        case 2:
          throw new ArgumentNullException("Two");
        break;    
        case 3:
          String template = null;
          result = String.Format(template, "Three");
        break;
      }
      return result;
    }
  1. Start the project in VSCode (F5 - With debugging)

  2. Browse to http://localhost:5000/api/values/1
    Debugger will catch exception and continuing will return the Developer Exception Page to the browser

  3. Browse to http://localhost:5000/api/values/2
    Debugger will hard crash the application

  4. Start the project in VSCode (CTRL+F5 Without Debugging)

  5. Browse to http://localhost:5000/api/values/2
    The Developer Exception Page is returned to the browser

Expected behavior

When encountering an ArgumentNullException the debugger should break on the offending line, display appropriate information, and allow for continued execution.

Actual behavior

The debugging session hard crashes along with the application.

@JHorvath-MaxetaTech
Copy link
Author

P.S. This appears to affect newer debugger versions, I had another developer with an older version test (sorry don't have the specific version number), and it worked as expected, but upon upgrading to the latest version 1.15.1, he encountered the same issue I did.

@gregg-miskelly
Copy link
Contributor

@JHorvath-MaxetaTech Thanks for reporting this! We should have a fix out very soon.

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

No branches or pull requests

2 participants