0

When I use ProjectCollection.GlobalProjectCollection to get a specified VC++ project in my VS extension development, it returns null. When I debug into the GlobalProjectCollection , I found it only contains C# projects(there are both C# and VC++ projects in my solution). Does ProjectCollection.GlobalProjectCollection only contain C# project? How can I get my VC++ projects?

Roman Pokrovskij
  • 9,449
  • 21
  • 87
  • 142
Terry Chen
  • 369
  • 3
  • 16

1 Answers1

0

Does ProjectCollection.GlobalProjectCollection only contains C# project?

Not exactly. According to the ProjectCollection.GlobalProjectCollection Property:

It applies to .NET Framework 4.7.2~ 4.0, not only for C#:

enter image description here

To get all projects in the solution, you can try to check this thread and this thread for some more details.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • 1
    I can get the VC++ project now, including IVsHierarchy and IVsProject object, do you knwo how to get/set properties of the VC++ project? Because I found Project Subtypes doesn't support VC++ projects. – Terry Chen Sep 27 '18 at 06:30
  • @TerryChen, Glad to know that you have resolved this issue, please share your solution here. This can be beneficial to other community members reading this thread and we could close this thread. I have seen you another post about the issue how to get/set properties of the VC++ project, I haven't had time to investigate it yet :(, there will be other community members to help you. – Leo Liu Sep 27 '18 at 06:39