What do I use in Visual Studio (C#) to perform the equivalent of Java's System.out.println( /*stuff*/ )
?
Does the output from the command show in the Output window in the IDE?
I have a button on a webpage that calls a service which returns a string. I want to see what's in the string and have tried all the variations below and nothing ever shows up in the output. It also doesn't stop on the breakpoint so I can check if there are any results.
var service = new OTest.TylerAPI.APIWebServiceSoapClient(); results = service.OdysseyMsgExecution("<Message MessageType='FindCaseByCaseNumber' Source='APIMessage' ReferenceNumber='1' NodeID='1' UserID='1'> <CaseNumber>T4CV0043212010</CaseNumber></Message>", "NMODYSSEYMETRO"); System.Diagnostics.Debug.Write(results);
out. println: Press Cmd+Shift+D.
Try: Console.WriteLine
(type out
for a Visual Studio or Rider snippet)
Console.WriteLine(stuff);
Another way is to use System.Diagnostics.Debug.WriteLine
:
System.Diagnostics.Debug.WriteLine(stuff);
Debug.WriteLine
may suit better for Output window in IDE because it will be rendered for both Console and Windows applications. Whereas Console.WriteLine
won't be rendered in Output window but only in the Console itself in case of Console Application type.
Another difference is that Debug.WriteLine
will not print anything in Release configuration.
Use Either Debug.WriteLine()
or Trace.WriteLine()
. If in release mode, only the latter will appear in the output window, in debug mode, both will.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With