Resolving .vcxproj dependencies with c# project class doesn't return included folders

472 Views Asked by At

I'm trying to write a tool which will resolve dependencies between c++ and c# projects. When I try to get folders included in vcxproj, it returns everything but included folders. I searched, where I would expect to find them:

ItemDefinitions -> ClCompile -> AdditionalIncludeDirectories

But they are not there, or anywhere else.

Project proj = new Project(projectFileName);

ProjectItemDefinition tp = proj.ItemDefinitions.First(pid =>
    String.Compare(pid.Key,"ClCompile", true) == 0).Value; 

ProjectMetadata tpPMD = tp.Metadata.First(pmd =>
    String.Compare(pmd.Name,"AdditionalIncludeDirectories", true) == 0);
1

There are 1 best solutions below

0
On

As I know, C# project and C++ project have different object. If you want to get the VC++ project you should reference VCProject and VCProjectEngine.

Here is an example about how to get the VC project you can refer to:

http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.vcprojectengine.vcproject.aspx