- Home /
How do you get OutputDebugString to show up in the Visual Studio output window?
Objective: As a programmer, when I add log statements to my code the output appears in the Visual Studio Output or Immediate Window.
Scenario: I added [DllImport] for OutputDebugString() to my project so that I can send messages to the Visual Studio Output window, however they don't show up there. How can I get that working?
I've found several comments that mention "Set Debugger type to Mixed or Native" (e.g. https://docs.unity3d.com/Documentation/Manual/windowsstore-faq.html) but I can't find where you do that in Visual Studio 2012. The Properties | Debug page has an option "Enable native code debugging" but that doesn't work. Besides, you can't set project properties in Unity auto-generated projects.
What does work: If I run "DbgView", I can see my log messages, but: 1) I would really prefer to see them in Visual Studio Output 2) it's very spammy since it includes both Unity internal messages, and the call stack for all UnityEngine.Debug.Log() statements. From research so far, you can't disable Unity including the call stack.
Your answer
Follow this Question
Related Questions
Visual Studio 2015 debugger can no longer attach to Unity after installing RC3 1 Answer
Unable to step. Operation is not supported 0 Answers
Impossible to use Visual Studio 2015 Debugger anymore (Unity 5.2.1f) 2 Answers
VS 2013: Breakpoint only if an error happens 0 Answers
Removing "Development build" text in a Windows Store App 0 Answers