0

Yesterday I went to debug a project as usual. I put a breakpoint on the line I wanted to step into the code at. I ran the solution and did something that should have triggered the breakpoint. But nothing happens. It just skips over the code.

So I put a System.Diagnostics.Debugger.Launch() call just before the line I wanted to break. Now, when I run the code and trigger the function, a window pops up that says:

The Just-In-Time debugger was launched without necessary security permissions. To debug this process, the Just-In-Time debugger must be run as an Administrator. Would you like to debug this process?

To which I say yes. But then it opens Visual Studio in another window and begins debugging the w3wp.exe process. I can step through some of the code but not all of the code, which is not very useful, since I can't get to the code I really want to debug.

  • I am running VS2019 as admin. Not sure why it asks me to run JIT as admin.
  • I have checked my Global.asax file and there's nothing there that is shutting down the debugger.
  • I've checked Event Viewer to see if maybe it could tell me something about the JIT debugger getting shut down by some other process before it can attach. But found nothing.
  • An IISReset didn't fix it.
  • I'm working with an Azure hosted web app with cloud services.

EDIT: I found this in the event log:

The description for Event ID 1015 from source Windows Azure Runtime 2.7.0.0 cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

1860
iisexpress
Role environment . FAILED TO INITIALIZE. hr: -2147467259

The message resource is present but the message was not found in the message table
toshiomagic
  • 1,335
  • 1
  • 12
  • 39
  • What is your project framework version? Please try to target your framework version to `net472` or restart your pc to test whether the issue persists. Besides,you can try to refer to [this similar issue](https://stackoverflow.com/questions/61866715/visual-studio-2019-break-point-is-getting-hit/61882779#61882779). Please let us know if it helps or not. – Mr Qian Jul 30 '20 at 10:10
  • Project framework is 4.7.2. Following steps in the linked SO question did not fix my issue. – toshiomagic Jul 30 '20 at 15:05
  • Delete or rename `c:\windows\system32\vsjitdebugger.exe`. Then check your `global.asax` file carefully and make sure that there is no exception on it. –  Jul 31 '20 at 10:25
  • Renaming the jit debugger did not work. There isn't any global.asax file issue. My coworkers can debug with same file just fine. – toshiomagic Aug 03 '20 at 17:09
  • @toshiomagic, please try to reset vs settings by `Tools`-->`Import and Export Settings`-->`Reset all settings`. 2) disable any third party extensions under `Extensions`-->`Manage Extensions`. – Mr Qian Aug 04 '20 at 02:09

1 Answers1

1

The issue was in the web app project settings. It was supposed to be set to use Local IIS and have a url that I specified which matches the web site running in IIS on my machine. Somehow this got switched to IIS Express and used a localhost:port# url. Since it didn't match my IIS setup it was not getting routed to my debug process. I don't know how this setting would have changed. I haven't even looked at it since last year and no one has changed the file in version control.

toshiomagic
  • 1,335
  • 1
  • 12
  • 39