error while trying to create DTE2 Interface object with ruby
-
22-09-2019 - |
Question
I am trying to use ruby win32ole
lib and DTE2 Interface to control visual studio 8 \
tried this
require 'win32ole'
ide = WIN32OLE.new('EnvDTE80.DTE2')
and received this error unknown OLE server: EnvDTE80.DTE2
what am I doing wrong, can this work at all ?
Solution
you are using the wrong object name, for visual studio 2008 and opening a solution called MySolution.sln :
require 'win32ole'
objDTE = WIN32OLE.new("VisualStudio.DTE.9.0")
objDTE.MainWindow.Visible = true #make VS window visible
objDTE.UserControl = true; #set to false to cause VS to shut down when the script ends
solution = objDTE.Solution
solution.Open("MySolution.sln");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow