I've got AvalonEdit embedded in a WPF application. As I resize, change text, etc, it continually sends debug messages to the console output window. Messages like:
OnHighlightStateChanged forces redraw of line 13
Building line 13
Is there any way to turn these off? There are lots of them and they bury my other debug messages.
Thanks.
(I'm on Visual Studio 2013).
Are you using a debug build of AvalonEdit?
You shouldn't see these if you use a release build / the official binaries (for example, from the NuGet package).
If for some reason you need to use self-compiled debug binaries of AvalonEdit, the answer is simple: remove the Debug.WriteLine() calls from the AvalonEdit source code.
Related
I have a managed project (.net 4.6.2) which calls into a native dll. If I put a breakpoint in the native code, it hits it, but if I try to inspect stack variables I get a rather annoying
Inspection of unmanaged type 'MyTypeInHere*' requires unmanaged
debugging to be enabled. Please set the debugger type to 'Mixed' and
try again
I followed steps from https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-debug-managed-and-native-code?view=vs-2019, Debugging unmanaged code while debugging managed code but I still cannot inspect types.
In the managed project properties, under debug I've enabled enable native code debugging and under the build page I've checked allow unsafe code. Further in launchSettings.json, I have "nativeDebugging": true
Also note that in the native project property settings I've set the Debugger type to mixed.
Does anybody know what's preventing me debugging native code?
Thanks
Does anybody know what's preventing me debugging native code?
It is quite strange and I followed the sample which your link provided and it works well. In fact, all the steps are just the rule.
So please check these:
1) Please make sure that your c++ project is using Active(Debug) Configuration and x64 platform. When you change Debugger type to mixed and then click Apply, please remember to rebuild the project.
2) when you reference the native code into C# project, please close the VS Instance, delete obj,bin,.vs hidden folder and then reopen your c# project. After that, please make sure that you check Enable Native Code debugging, then rebuild the entire solution.
3) Add breakpoints where you want to break and begin stepping through the code. Make sure your have placed your breakpoints in code which the C# application calls into.
4) change the target gramework to 4.7.2 to test again.
5) Please try to create a new net framework 4.7.2 c# project to test whether the issue is caused by the old project.
In addition, if all the steps does not work, please do a repair in VS Installer.
I'm developing a gcc application using Visual Studio 2015 as an IDE. The debugger is gdb.
The application creates it's own window. When I compile with a DEBUG switch, I need the application to also spawn a console window. It's used for debugging and outputing printf's from multiple threads. Thanks to the "-mwindows" switch, this works correctly when I execute the application from outside Visual Studio.
Unfortunately, when I run the application from within Visual Studio, it seem to steal the console window. No console is spawned, and the printf's output are redirected to the Output Debug window.
This wouldn't be much of a problem if the VS console actually printed the "\n" correctly instead of stripping them out of the ouput. Everything gets printed on the same line, and the output becomes unreadable. Try as I may, I couldn't get VS to insert a newline in the Output Debug window. I searched online a lot, and this problem seems to be well documented, but I couldn't find a satisfying answer.
At this point, either of these solutions would work for me :
Prevent Visual Studio from stealing the application's console window;
Add special characters to all my printf in order to make the Output Debug print line feeds and carriage returns.
EDIT :
Ideally, the solution should be cross-plateform, in a sense that it should not add dependency to WinAPI.
EDIT2 :
"\t" seems to work as intended. Why does "\n" doesn't work? I also tried "\r\n" to no avail.
I was contacted by a Senior PM Manager for Visual Studio at Microsoft regarding this issue. I posted it as a "feedback" inside Visual Studio, about four months ago (around the time I posted it here)..
He acknowledged the problem, and said they're gonna try to add support for external consoles with Update 3.
I have a GTK+3.0 project running in VS2013
I added to my linker command line options this argument:
/ENTRY:mainCRTStartup
I suspect that might be related to the fact that I have no output in VS that shows the messages printed with g_print
I also tried calling printf and see no output in VS2013's output window, nor the "immediate window"
Does anyone have experience building C projects in VS2013 that use GTK+ 3.0 that could maybe tell me where I can see the messages printed by g_print and/or printf, or perhaps can you suggest a different way to debug print?
More details about how I set up the project in VS2013:
How to configure gtk on Visual studio 2010
Error 3 error LNK1104: cannot open file 'gtk-3.lib'
Compiling a GTK3 program in Visual Studio 2012
To those who want to know..
I found the answer.
In my first link, the direction was to do the following:
While we are still in the view of the Project Properties, click on
Linker and then System. Look for SubSystem on the right and click the
drop down box. Select Windows /SUBSYSTEM:WINDOWS
If you omit this step, you get a GTK window and a console, where you can read the output of printf().
I'm developing a windows phone 7 library which needs to display log messages to developers. Warning: I'm somewhat new to .Net.
It doesn't appear that System.Diagnostics.Trace is available on Windows Phone 7. I also tried Console.Writeline but it doesn't seem to do anything. So far the only thing that works is Debug.WriteLine() but when I build the library as a "Release" build, the logging goes away.
A) Has anyone found a way to log or trace from a "release" build of a Windows Phone 7 App?
B) Is there a way to build a release build (no symbols and optimized) that still has Debug output turned on.
Thanks,
You might like to check out this recent release.
Silverlight and WP7 Exception Handling and Logging building block
I'm using Windows 7 Professional (x64) and having installed .NET 4.0 RTM on my machine.
Since 2 days I'm noticing that every WPF application that I'm trying to run hangs and becomes non responsive (a not responding text is appended to it's title bar) and it's painted white.
There is no info regarding any exception, no error message. Nothing. Even the Event Log shows that there was "application hang" event (code 1002) and nothing more.
This problem is for everything that is written in WPF, even for products like NHibernate Profiler and other stuff that I was using on a regular basis without any issues.
Tried to reinstall .NET 4.0 and nothing changed. Any ideas why this might be happening?
I had the same problem. It was a corrupt font cache!!
See http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/7cc032c1-5f4d-4518-adc6-f53afd051e6b for a solution.
If I had to guess I would say video drivers. It might help to try attaching Visual Studio's debugger to the hung process (Debug -> Attach to Process) making sure that Managed Code is the selected debugger type. Then you can break into the debugger and maybe see a common stack trace.