简体   繁体   中英

C# in Visual Studios: How to print to console during a break point

I do not normally code in C# and was wondering if Visual Studio had a particular debugging feature that is similar to the Python Debugger. In the PDB, during a breakpoint I will often print certain function calls and variables as well as test certain if statements. Although I can see variables in the 'locals' tab, I can't do print statements like list[i] or foo(var) or if(f(x) == 1) which I think are powerful debugging tools. Is this feature at all available in VS? Thanks for the help.

In Visual Studio, you can "Insert Tracepoint" from the context menu under "Breakpoint". Alternatively, you can create a breakpoint and open its properties then set the "Actions" checkbox.

插入跟踪点

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM