I modified the C # plugin that comes with Python Tools for Visual Studio 2.0 and want to see the output from the Debug.WriteLine and Trace.WriteLine commands in the code. Please note that the plugin is used in Visual Studio 2013 itself, changing the debugging of python processes ....
I hope to add a trace listener to devenv.exe.config, as pminaev suggested in the PTVS discussion forum here (adding another VS VS itself seems awkward, so I hope to avoid that).
What I think is correct for other .NET applications does not seem to work for VS2013. My efforts are described below.
If someone managed to redirect the debug / trace output of the plugin to the Visual Studio console (or somewhere else more convenient than another connected VS instance), the tips are very much appreciated ....
A few examples appeared in my Google-fu, based on which I tried to add ...
<system.diagnostics>
<trace autoflush="true" />
<listeners>
<add name="myConsoleTraceListener" type="System.Diagnostics.ConsoleTraceListener" />
</listeners>
</trace>
</system.diagnostics>
... and ...
<system.diagnostics>
<source name="System.ServiceModel.MessageLogging" switchValue="Verbose, ActivityTracing">
<listeners>
<add name="myTraceListener" />
</listeners>
</source>
<sharedListeners>
<add name="myTraceListener" type="System.Diagnostics.ConsoleTraceListener" />
</sharedListeners>
</system.diagnostics>
Starting PTVS afterwards, nothing useful. With any configuration, I get a popup:
The `Python Tools Package' package id not load correctly.
The problem may have been caused by a configuration change or by
the installation of another extension. You can get more information by
examining the file
'C:\Users\XXX\AppData\Roaming\Microsoft\VisualStudio\12.0\Acti
vityLog.xml'.
ActivityLog doesn't really matter to me:
<entry>
<record>41</record>
<time>2014/05/12 07:52:47.851</time>
<type>Error</type>
<source>VisualStudio</source>
<description>CreateInstance failed for package [Python Tools Package]</description>
<guid>{6DBD7C1E-1F1B-496D-AC7C-C55DAE66C783}</guid>
<hr>80131604</hr>
<errorinfo>Exception has been thrown by the target of an invocation.</errorinfo>
</entry>
<entry>
<record>42</record>
<time>2014/05/12 07:52:47.851</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [Python Tools Package]</description>
<guid>{6DBD7C1E-1F1B-496D-AC7C-C55DAE66C783}</guid>
<hr>80004005 - E_FAIL</hr>
<errorinfo>Exception has been thrown by the target of an invocation.</errorinfo>
</entry>
When I try to connect to a remote python process, I get another popup:
Unable to connect to 'secret@server'. Operation not supported.
Unknown error: 0x80131902.
Google-foo assumes this is some error loading the .NET version ...?