I get a list of projects using following:
var solution = (IVsSolution)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(IVsSolution));
Refer following link for more details.
But it gives me each and every item in the solution like Directories, projects, etc. I require only projects.
How can I get only projects from the solution?
I tried and got the expected results. There may be other better solution but this actually works for me.
var projects = CommonMethods.GetProjects(solution).Where(item => item.FullName != string.Empty).ToList();
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