8

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?

2
  • 1
    Can you try npm i -g azure-functions-core-tools@core --unsafe-perm true and re-start VS under admin privileges Commented Aug 9, 2019 at 14:15
  • I'm seeing a similar issue. Which version of Node are you using? Commented Aug 30, 2019 at 19:47

2 Answers 2

12

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

Sign up to request clarification or add additional context in comments.

5 Comments

It may be a bug in newer releases of VS. I have this issue in the latest one - VS 2019 16.2.4. It's now under investigation here on developercommunity.visualstudio.com since July 30 2019
This is still an issue. I just had to make this change for an HTTP Trigger Azure func in VS2019 16.3.9
Nope I have this issue March 2020, VS 2019 16.4.5
Nope; I always had that checkbox unchecked and modules are being loaded. Its just saying that my project dlls ARENT my code?! Only the WebJobs dlls are being considered 'my code'. Very weird, this only started happening recently
This is still a problem with the webjobs sdk in Visual Studio 2022. In my case it was a net6 webjob console app that couldn't hit a breakpoint to save its life, until I unchecked that box and it finally started working again.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.