How to get "Include Paths" property of Microsoft Macro Assembler in Visual Studio by a plugin?

Viewed 30

I'm workng to get include path resolved by some VS plugin (asm-dude in fact). Include path in microsoft macro assembler looks like this: includepath

Include file resolve part in asm-dude lies in: https://github.com/HJLebbink/asm-dude/blob/vxix2022-B/VS/CSHARP/asm-dude-vsix/Tools/LabelGraph.cs#L602

Anyway, at the beginning I think I just need to get the value of IncludePath property, and then other things can be done in a minute. But after reading some docs I realized I'm in a mess. It seems that VS prevents me to get names of all properties, but I can only get the value by the name.

Codes I write are like:

DTE dte = Package.GetGlobalService(typeof(SDTE)) as DTE;
Projects projects = dte.Solution.Projects;
if (projects.Count != 0)
{
    VCProject project = (VCProject)projects.Item(1).Object;
    VCConfiguration cfg = project.ActiveConfiguration;
    if (cfg != null)
    {
        string includePathStr = cfg.GetEvaluatedPropertyValue("IncludePaths");
    }
}

but in vein, it gets include path of msvc, not MASM

I cast Project to VCProject because it's a VC project. Although I can iterate properties of a non-VCProject's configuration, but it doesn't seem to work on VCProject, because it doesn't have a (at least not public) member named properties. All these docs tell me that I can only get its value by name, but the problem is I don't know its name. Or I'm completely wrong? I must admit that I'm new to VS plugins.

refs I used so far:

https://docs.microsoft.com/en-us/previous-versions/dn655034(v=vs.140)?redirectedfrom=MSDN

https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.vcprojectengine.vcconfiguration?view=visualstudiosdk-2022

0 Answers
Related