直接上代码
private List<string> GetVcDependeceis(EnvDTE.Project proj)
{
List<string> ret = new List<string>();
VCProject vcProj = proj.Object as VCProject;
VCReferences refs = vcProj.VCReferences;
//***索引必须从1开始
for (int i=1; i<=refs.Count; ++i)
{
object o = refs.Item(i);
VCProjectReference aRef = o as VCProjectReference;
if(aRef == null)
continue;
//此处只有调用了Name接口,FullPath才可用,MS这个BT玩意
string name = aRef.Name;
ret.Add(aRef.FullPath)
}
return ret
}