Paul Stanley
Paul Stanley

Reputation: 2161

Visual Studio 2019 not entering break point in Azure Functions local debugging mode

I have accidentally made a setting change to VS2019 and I can't get back to how it was.I was debugging a Azure Functions project with out any problems. I was trying to set up the project to use XUnit to test the functions and set the appropriate start-up projects. I couldn't get the azure functions project to hit debug breakpoints. In the end I gave up and decided to use two instances of VS2019 but now I can't hit any breakpoints int the Azure Function app. I also noticed the command prompt window which starts when you run the app doesn't shut down when you click stop in visual studio. I saw a SO question saying to check:

Use Managed Compatibility Mode.//should be Unchecked

And unchecked which it is. Any ideas on what setting is incorrect?

Upvotes: 8

Views: 2747

Answers (2)

RichyRoo
RichyRoo

Reputation: 420

For me, somehow my own project had been added to the exclude list in Debug => Options => Debugging => Symbols => Specify Excluded Modules

Upvotes: 0

BobbyTables
BobbyTables

Reputation: 4685

TLDR: Uncheck the "Automatically close..." option in the image below.

I have encountered the same problem with Azure Function projects, and found a solution to this. Symptoms:

  • Breakpoints are not being hit (silently ignored by VS)
  • Adding a breakpoint during debug gives a white breakpoint and "Breakpoint wont be hit..." message

The reason for this is that modules are not being loaded. This can be confirmed by opening the "Modules" window in VS during debugging (ctrl+alt+U, or search for it in top right). This window was empty for me (but filled with references if i was debugging a console application for example).

To get module loading to work, i had to uncheck the debugging-option "Automatically close the console when debugging stops". And suddenly my modules-window was filled during debugging, and breakpoints working.

enter image description here

Upvotes: 12

Related Questions