views:

196

answers:

0

How can I attach and automate a specific instance of the VisualStudio.DTE from Ruby? It works fine when only one instance is running, but when multiple instances are running, WIN32OLE.connect("VisualStudio.DTE.9.0") only connects to the first one launched.

A non-Ruby specific approach would also be appreciated.

According to this KB article: Attaching to Specific Instances of the IDE, the Item monikers "VisualStudio.DTE.9.0!pid" can be used, but that does not work with either WIN32OLE.new or WIN32OLE.connect.

Using IROTVIEW.EXE, the names are listed as "!VisualStudio.DTE.9.0:pid", but that doesn't work with WIN32OLE either.