Where should a project system implement IVsGetCfgProvider

Hello,

Based on the BscPrj sample and the MPF project sample, a project system implements IVsCfgProvider on the same object that implements IVsHierarchy.

Should a project system always implement IVsGetCfgProvider on the same object as IVsHierarchy   This seems to be the case in the sample code but doesn't seem to happen in C# nor VB .NET projects.  I'm listening for OnAfterOpenProject in my package, which passes in IVsHierarchy reference.  In the case of the sample projects, I can do a QI to get the IVsGetCfgProvider interface.  This doesn't work for C# nor VB .NET projects.

Thanks,
Notre


Answer this question

Where should a project system implement IVsGetCfgProvider

  • polmau

    Thanks to a MS email, the answer is the following:

    We give several options to where a project implements IVsCfgProvider[1,2] and IVsProjectCfgProvider. The options are:< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
    1. We first try to get the VSHPROPID_BrowseObject for the VSITEMID_ROOT (via IVsHierarchy::GetProperty) and see if it implements IVsGetCfgProvider or IVsCfgProvider
    2. Next we try to QI for IVsGetCfgProvider
    3. Next we try to QI directly for IVsCfgProvider

  • Where should a project system implement IVsGetCfgProvider