Using OutputDebugString is a common debugging technique for user mode debugging.

In UWP/UAP/Metro app developement on Windows 10, this debugging function is still available.

However, I would like to observe OutputDebugString messages without attaching Visual Studio debugger (EDIT: or WinDbg).

Latest version of DbgViewer from SysInternals is able to observe UWP debug output, but I can't find the source code for this tool.

Actually, DebugViewPP from CobaltFusion appears to work for win32 apps only.

As a workaround, I could simply use LogginChannel.LogMessage but I'm currently more interested by how OutputDebugString API work under UWP.

1

There are 1 best solutions below

0
On

OutputDebugString function exists in Kernel32.dll file, if you want to use it in UWP, you can import the dll file by DllImport.

[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern void OutputDebugString(string message);
private async void Button_Click(object sender, RoutedEventArgs e)
{
    OutputDebugString("~~~OutputDebugString");
}