Seeing the Debug.WriteLine output from PTVS C# dlls

May 9 at 7:18 AM
Hello,

I've done...
Python> msbuild Pythontools.sln
Python\Setup>powershell -ExecutionPolicy RemoteSigned .\BuildRelease.ps1 c:\temp\ptvs_inst -skiptests
...and installed the PTVS VS 2013 Debug.msi file created on another PC, but am not sure what's happening to the Debug.WriteLine output. Do I need to do something further to enable it? Where should it be visible?

For example, in PythonProcess.cs HandleModuleLoad() your code writes trace (I haven't changed that code), and I can see the ptvsd-side module events being sent across the TCP connection but there's no "Module Loaded (1): filename" trace in the Output / Immediate Window / Command Window / anywhere-else-I-can-think-to-look in VS.

Any tips greatly appreciated.

Cheers,
Tony
Coordinator
May 9 at 7:35 AM
Debug.WriteLine goes to the debugger, if you have one attached. You can start another instance of VS and attach to the first one; then you'll see it in the Output window of the attached VS instance.

Same thing for Trace.WriteLine (except that it traces in release builds, as well).

You should also be able to add trace listeners in devenv.exe.config to tee this to a log file etc, as with any other .NET app - though I haven't tried it with VS.
May 9 at 10:33 AM
Thank you for background information (my .NET experience is limited - sorry!) and leads. I'm trying modifications to devenv.exe.config - lots of online docs suggest that...
<system.diagnostics>
    <trace autoflush="true">
        <listeners>
            <add name="myConsoleTraceListener" type="System.Diagnostics.ConsoleTraceListener" />
        </listeners>
    </trace>
</system.diagnostics>
...should work, but that would be too easy ;-). Will post again next week when I have something working, but it's Friday beer-o'clock here.

Cheers,
Tony