Visual Studio startup unhandled exception in Microsoft.ServiceHub.Controller

Rodrigues, Clive 0 Reputation points
2023-01-31T18:48:03.9366667+00:00

VS error

I try to attach a debugger 4 times. It gives me the same Choose JIT Debugger prompt.

If I click cancel to attaching the debugger, the changes I make to my application aren't reflected when debugging.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,888 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 51,346 Reputation points
    2023-01-31T19:58:32.8966667+00:00

    If you're getting an exception that is preventing VS from starting then repair the VS installation. If you're getting a message about a package failing then normally you can tell VS to ignore it and move on.

    If you're triggering the JIT window then note that trying to use the debugger associated with the version of VS that is failing (e.g. 2022 for 2022 or 2019 for 2019) won't work as it has to start VS, which is throwing the exception. So if you're seeing the exception starting VS 2019 then use the VS 2022 debugger to debug it and vice versa. But most likely attaching the debugger isn't going to show you anything useful.

    Run VS in safemode (use /safemode command line) and see if it works. If it does then the issue is with a package. Use /log to log the VS activity. Then replicate the issue and grab the log. The default location is under your roaming profile.

    0 comments No comments

  2. Tianyu Sun-MSFT 29,446 Reputation points Microsoft Vendor
    2023-02-21T10:17:49.2866667+00:00

    Hello Rodrigues, Clive

    May I ask if you have kindly followed Michael’s guide to troubleshoot this issue? Please let us know if your issue was solved or not.

    I suspect that the exception is caused by the installed extension/package. Did you install and use any extension or package? Please try the suggestions that shared by Michael to narrow down this issue and try to disable/remove/reinstall the package/extension.

    In case the exception is caused by .NET Framework, please try to use Microsoft .NET Framework Repair Tool to repair and fix the .NET Framework.

    In addition, please try to update Visual Studio 2019 from VS Installer, and try to reset VS settings.

    but the changes I make aren’t reflected when debugging.

    Do you mean after you canceled to attach the debugger you started to debug your application, but the changes in your project weren’t reflected to your application when debugging?

    If so, are the changes related to any references/assemblies/packages/extensions? If you change other for example some simple things, will the newer changes be reflected when debugging?

    If any changes including simple changes cannot be reflected when debugging, I may suggest you try to reinstall VS(if repairing VS doesn’t work).

    Feel free to contact us.

    Sincerely,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments