How to get list of projects in current Visual studio solution?
问题 When we open Package Manager Console in any open solution, it shows all the projects of that solution. How it is loading all the projects of the same solution. When I tried with below shown code it is fetching me projects of the first solution which I have opened. private List<Project> GetProjects() { var dte = (DTE)Marshal.GetActiveObject(string.Format(CultureInfo.InvariantCulture, "VisualStudio.DTE.{0}.0", targetVsVersion)); var projects = dte.Solution.OfType<Project>().ToList(); return