我怎样才能从溶液中唯一的项目? [英] 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));
请参照下面的链接了解更多详情。
但它给我的每而像目录,项目等
我只需要项目解决方案的每个项目。
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();
这篇关于我怎样才能从溶液中唯一的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文