C#中VCProjectEngine的VCProjectReference

直接上代码


private List GetVcDependeceis(EnvDTE.Project proj)

{

List ret = new List();

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

}

你可能感兴趣的:(c#)