I have created a new VS 2010 extensibility package. So far, all I want to do is have the user press a button and fill a listview with the entire contents of the solution. I have the following code:
EnvDTE80.DTE2 dte = (EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.
GetActiveObject("VisualStudio.DTE.10.0");
foreach (Project project in dte.Solution.Projects)
{
foreach(ProjectItem pi in project.ProjectItems)
{
listView1.Items.Add(pi.Name.ToString());
}
}
This does seem to work, however, it populates the list with the contents of the solution with the package in it and not the experimental instance that is launched when this is run. Am I instantiating the reference wrongly?
GetActiveObject method returns first process instance of DTE, not caller DTE. (in Visual Studio SDK 2010 project on Visual Studio 2010, type F5 to execure experimental hive may fail)
Look at here and here for more details...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With