Show Console.WriteLine output in Debug window of JetBrain's Rider IDE - console

I have a C# WPF project that uses System.Console.WriteLine for debugging and in Visual Studio we can see the output in Output window.
I would like to move to JetBrain's Rider, but the Console output is not shown in the Debug Output window, unlike the output from System.Diagnostics.Debug.
I understand that I should've used System.Diagnostics to begin with and would be willing to brute force replace all calls in my code, but I'm wondering, if there is a setting in Rider that could spare me the hassle ...and discussions with colleagues ;o).

Related

Debug certain lines in RTVS (R Tools for Visual Studio)

Currently the only way to debug in RTVS is to first attach the debugger and then source the file, as shown in this official manual. However, this is rather inconvenient, since my script usually expands to hundreds of lines and it will take forever for the debugger to execute to the breakpoint, which usually at the last of the script.
The only workaround I can come up with now is to comment all the above lines before the codes of interests. But, is there any elegant way to achieve that?
So far there is no shortcut for it yet, to debug the certain line in R, we still have to launch the debugger with the code in script.R by either selecting the Source startup file button on the toolbar, selecting the Debug > Source startup file menu items, or pressing F5. Visual Studio enters its debugging mode and starts running the code. It stops on the line where you set the breakpoint:
https://learn.microsoft.com/en-us/visualstudio/rtvs/getting-started-with-r#debugging-your-code

Keep Watched Variable Tab Open After Debug

When I'm debugging in Visual Studio I like to see an object and all its nested properties open in a watch window. How can I persist that watch window so I can view it as a tab after I've ended the debugging session?
You can not see the value of watching of your object if you close debug. What you can do how ever is to use the functions that System.Diagnostics library offer to monitor some of your variables.
and by using this code
Debug.Write("value of :" + YourVariable);
you can then use the DebugView from Sysinternals to monitor that debug output.

Freopen() not working in SDL

I tried using freopen() to redirect the "cout" function to the console, but it doesn't produce the desired effect. Instead of just double clicking on the executable and having the console show it's message, I need to use a command prompt or a batch file, and that's a problem, because I want the user to be able to close the console after the message has been displayed without closing the SDL window. This is supposed to be a console application. I apologize if I am not clear enough.
If using freopen() doesn't work the SDL Console FAQ gives a tutorial on recompiling the SDLmain library that is relatively easy to understand, especially if you already have MSYS and MinGW installed. You can use the resulting SDLmain library instead of your current one and it should work (It did for my project).

Why Arent Breakpoints Working In Web Application Project

My company gave me a web application project and I went to debug it and set some breakpoints and they dont fire. I am using Response.Write all over the place to debug. Anyone know what maybe going on?
I am running the application off my localhost I was pushing F5, but since the breakpoints dont hit by making changes and adding Response.Write statements and clicking save then refreshing my browser I get the changes for whatever reason.
Hovering over the breakpoint it says "The breakpoint will not currently be hit the source code differs from the original version"
Another tidbit is I created a new web application project and created a breakpoint and it works, its only specific to this application it seems like, but dont know what it could be?
Hovering over the breakpoint it says "The breakpoint will not currently be hit the source code differs from the original version"
Try this:
Close Visual Studio and make sure any instances of ASP.NET development server are closed as well
Delete everything from "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files" (where v4.0.30319 is the version of your .NET Framework)
Definitely need more info, but I would check that your are building with debugging symbols to cover the dumb stuff.
Okay, after reading the comments posted on your question I was making the following assumptions.
You are running using the built in VS development server
You are compiling in debug mode
You've set debugging true in your web.config
I've seen this problem before and for me it's been resolved by restarting Visual Studio.
Assuming that you are running on IIS on the same machine that you have visual studio installed:
Have you attached to the application pool process
Is you code the same as what is deploy? (Is the latest version deployed)
Are you logged in as administrator?
Are you running visual studio as administrator?
Just to make sure, you are running in debug mode?
I ran into this problem a while ago as well, instead of using response.write, you could try outputting the data to a label control's text value instead to see the values of your code.
It's a bit of a sloppy work around, but I couldn't figure out why that one particular project I was working on didn't let me debug it.
This problem is, for me, mostly caused by a mismatch of the loaded dll files (symbols) by webserver, and those that the project are pointing to when you try to breakpoint. It's different files. I have located different causes. One could be a simple hang-up by webdev instans (force shutdown. But also that there occur some kind of mismatch if you got different compilation methods between project within same solution as the web project.
This desc may not be your exact problem, but perhaps it will lead you into right direction. I find this often being a dirty unlogic error that just are irritating (but also completely fixable without data loss or reconfiguring, when u understand the trick).
I had the same problem, and it turned out only Internet Explorer works with debugging and breakpoints. To avoid having IE as my default browser, I changed the launch settings in the .Web project to run IE with the path as command line parameters.

Flex trace() doesn't print

There's a lot of examples for ActionScript over the web using trace() to print results.
I'd tryied it using Flash Builder 4, but it don't print to the console. Where can I see the output?
Are you in debug mode ?
Put a breakpoint on the line where the trace() is wrote (ctrl+shift+b), debug and see if the trace is reached.
Are you printing the right string? try to use also a static text in front when doing trace like trace("Loading file: ", _myFile.url);
If you do not want to use Flash Player debugger, but you want to log messages without annoying Alert popups, you can easily
log to the Firebug console.
Are you sure that you are running the debug build and not the release build?
I had the same problem even with the debug player. I could step right past a trace call in the debugger with no console output. I was pulling my hair out checking mm.cfg, flex-config.xml, .actionScriptProperties and all the options I could find in FlexBuilder. Nothing worked...
..until I rebooted my machine (Windows XP 64-bit). No other changes necessary!

Resources