A great way to debug your code is to write values or notifications out to the debug window. Adding a simple line like so should write the text to your Debug window in Visual studio:

Debug.WriteLine("Something really cool just happened")

But when you run your code your Debug window stays empty:

What’s going on here? Well, there’s an option to send all of the debug output to the immediate window and this is turned on by default. This isn’t what we want, so to change it go to Tools -> Options and select Debugging -> General. In the list of checkboxes you will find Redirect all Output Window text to the Immediate Window. Uncheck this and click OK.