I have an instance of Project
and I donβt understand how to find out the type of project / language. In particular, I need to check out a C / C ++ project.
docs seem to be missing.
Earlier, another person added the following bit of magic to my open source VS extension, and it worked in VS2013-2015:
private static bool isVisualCppProject(object project) { Type projectObjectType = project.GetType(); var projectInterface = projectObjectType.GetInterface("Microsoft.VisualStudio.VCProjectEngine.VCProject"); return projectInterface != null; } ... isVisualCppProject(project.Object);
But it no longer works in VS 2017 RC. And I would gladly get rid of this magic of reflection of runtime and not type object
and dynamic
instead of Project
- because of this, the code already becomes unattainable.
source share