No "run" or "debug" command available in PTVS

Nov 9, 2011 at 3:57 PM


On my installation of PTVS there is no menu entry / icon for executing or debugging the current project. When I select Menu->Project->Start with Debugging I get the error message: "Operation is not valid due to the current state of the object.

The only thing that works is the interactive shell.

Does anybody have any idea what is wrong with my setup?

Many thanks


Nov 9, 2011 at 4:46 PM

How is your interpreter configured?  Was it an interpreter we picked up from the registry (CPython 2.5-3.2 or IronPython) or is it a manually configured interpreter?  If it's manually configured does it have PYTHONPATH set? 

Does Debug->Start without Debugging work?

Nov 9, 2011 at 4:52 PM

Hi dinov, thanks for trying to help with this.

The interpreter is CPython 3.2 which was picked up from the registry.

Start without Debugging works fine.


NB: Am I right to assume you are from the PTVS team? If so I want to take the opportunity to congratulate the team on a really superb job. From what I have seen so far, this PTVS will make finally make python an option for those non-experts who depend on an easy to use IDE in their day to day work.

Nov 9, 2011 at 4:53 PM

In case this is relevant: I did a bare-bones install of VS: no compilers etc at all. I already had VSC Express installed on the same machine...

Nov 9, 2011 at 5:05 PM

Yep, I am part of the PTVS team.  Thank you for the kind words!

Would you be willing to attach another copy of VS to the copy of VS doing the debugging, enable breaking on all exceptions in Debug->Exceptions,  disabling just my code in Tools->Options->Debugging, and do the debug launch?  Hopefully you'll break in on an InvalidOperationException and if you could paste the call stack here that could be extremely useful.  Right now I don't have any ideas off the top of my head what could be causing this.


Nov 10, 2011 at 9:26 PM

I attempted to debug as suggested but I ran into a problem: Presumably because I had installed VS without MSVC there was no option to attach to a running process. The installed MSVC++ Express does not allow attaching to running processes.

I decided to clean-up my install and deinstall all my legacy VS components and reinstalled VS 2010 with MSVC to be able to attach to a running process. Now, debugging is available!

I see two possibilities:

1. the debugging functionality needs MSVC installed as part of VS

2. the debugging functionality somehow conflicts with the other VS components (MSVC Express & legacy)

Many thanks for your help!

Nov 10, 2011 at 9:37 PM

I'm glad you were able to get it working! 


You previously mentioned doing a barebones install of VS - was this installing something like Ultimate/Premium/Pro and unselecting all of the various install options?  If so I don't think we've actually tried that scenario (we do test against the integrated shell, but that may be different).  We should probably give it a shot and see if we run into the same issue.

Nov 10, 2011 at 9:41 PM

Yes, the installation was a VS Ultimate with all options deselected as I already had the VS MSVC++ Express installation.

I don't think many people will do a bare-bones install of VS and run into this problem: normally it just does not make sense...