I've modified a C# plugin that's part of Python Tools for Visual Studio 2.0, and want to see the output from Debug.WriteLine and Trace.WriteLine statements in the code. Note that the plugin is used in Visual Studio 2013 itself, modifying debugging of python processes....
I'm hoping I can add a trace listener in devenv.exe.config
as suggested by pminaev on the PTVS discussion forum here (attaching another VS to VS itself seems clumsy so I'm hoping to avoid that).
What I believe to be correct config for other .NET applications doesn't seem to work for VS2013 itself. My efforts are documented below.
If anyone's managed to redirect plugin debug/trace output to the Visual Studio Console (or anywhere else more convenient than another attached VS instance), tips greatly appreciated....
My Google-fu turned up a couple examples, based on which I've tried adding...
<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's usable. With either config 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'.
The ActivityLog doesn't mean much 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 attach to the remote python process I get another popup:
Unable to connect to 'secret@server'. Operation not supported.
Unknown error: 0x80131902.
Google-foo suggests this is some failure to load a .NET version...?