Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get only projects from the solution?

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?

like image 724
Palak.Maheria Avatar asked Apr 02 '14 06:04

Palak.Maheria


1 Answers

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();
like image 177
Palak.Maheria Avatar answered Oct 20 '22 15:10

Palak.Maheria