I ran into an unexpected thing today. I was trying to get a debug line to print in the output console in Visual Studio for an ASP.NET site I’m working on, and it didn’t make sense to me. I eventually figured it out, and decided to make a note of it because I know I will probably need it again, and also know that it might help someone else.
I had a variable at the data access level, and it didn’t seem like it was doing what I wanted. I added a simple
Console.WriteLine("ISERROR=" + Convert.ToString(variableNameHere));
but this didn’t display anything in the Visual Studio output window like I expected.
I then used this instead, and it worked great. There was my variable, with an unexpected value.
System.Diagnostics.Debug.WriteLine("ISERROR=" + Convert.ToString(variableNameHere));
That’s it. I hope this helps someone else out there.
-Adrian
