Equivalent of console.log in C#

Trace.WriteLine will do (and probably more methods from the Trace class). You can use a program called DebugView to real-time monitor the trace generated, or write to a log file using you web.config file.

Categories c# Tags

Embedded statement cannot be a declaration or labeled statement

You have a statement (if or while, for example), right before the code you posted, without curly braces. For example: is correct, but the code below: will result in CS1023: Embedded statement cannot be a declaration or labeled statement. UPDATE The reason, according to @codefrenzy, is that the newly declared variable will immediately go out of scope, … Read more