How does Visual Studio switch between python and C# expressions when debugging a process that mixes both C# an Python by embedding and invoking python interpreter?
For background: My Visual Studio 2015 with PTVS 2.2.2 did not allow me to specify any python expressions in the watch window (on at least two machines), until something switched, and now it only allows using Python expressions in the same watch window (but not C#).
I am not sure what I did, is there a proper way to switch between the two languages?
Once Python expressions started working, the C# expressions now all fall back on 'internal error in expression evaluator' both in watch and immediate window. The whole thing might have been related to me playing around with Python Debug Interactive window, but it feels very ad hoc and I am wondering how to properly configure this.
There seems to be a bug/issue in PTVS and/or Visual Studio in that the watch window does not realize that the context has switched to Python, unless there is at least one call to a python method in the call stack. so if embedded script does: print ('foo') , the watch window thinks it's still in c# context.
If the embedded window has this instead - the watch window switches to Python
def Test(): print ('foo')
Test()