Get the reference of the DTE2 object in Visual C# 2010
问题 I want to get a reference to the current solution, using the DTE2 object with C# in Visual Studio 2010. I first tried the following code: var dte = Marshal.GetActiveObject("VisualStudio.DTE.10.0") as EnvDTE80.DTE2; But when I open 2 solutions, and this code is in the first solution, I get NOT a reference to the current solution, but a reference to the last solution I loaded. I need the current solution... Searching on the internet, I found the following solution in How do you get the current