locked
Extensibility Question on WebSite projects RRS feed

  • Question

  • hello people,
    I have developed a C# VsPackage using the MPF. In the MyPackage Class, Initialize() ,
    I am initializing the Properties Extender to the EnvDTE interface like this:


    for (int i = 0; i < CATIDs.Length; i++){
    ExtenderProvider dynamicExtenderProvider = new ExtenderProvider();
    Cookie[i] = _extensionManager.RegisterExtenderProviderUnk(CATIDs[i],
    dynamicExtenderProvider.DynamicExtenderName,
    dynamicExtenderProvider,
    dynamicExtenderProvider.DynamicExtenderName);
    }

    the registration happens fine, and I register all the different types of CATIDs, that I have gotten from :
    http://msdn.microsoft.com/en-us/library/bb164669(VS.80).aspx


    class ExtenderProvider is derived from EnvDTE.IExtenderProviderUnk and implements the interfaces CanExtend and GetExtender.
    So for all other projects(C#/VB/C++ application ) whenever a selection changes in the solution explorer, I get a callback to CanExtend ,
    and I check if I support that CATID OF THE SELECTED iTEM. Based on the return code, the GetExtender call happens,
    and then I populate all the extra properties of the selected file in the Solution Explorer, and display those in the Properties Browser. This works fine for normal projects.

    But there's something special about Website projects, and I have seen that when a Website type of project is created, upon selection change
    in the Solution Explorer I don't get a callback to CanExtend , nor to GetExtender. So for Website projects, I can't display the extra properties
    of the selected file, although I need to.

    What could be the reason for this! Am I missing something here?

    previously I was under the notion that installing SilverLight solves the problem, but today I checked with SilverLight too - but
    still I don't get the callbacks!

    Any clues, anyone?

    thanks and regards,
    soumm

    Note : I am using VS2005 for my C# package development, and the target platofrm is also VS2005(SP1). The SDK is also for VS2005 !
    Development and Target OS is WinXP Professional.

    • Edited by soumm Monday, January 25, 2010 7:11 AM provided more information
    Monday, January 25, 2010 6:55 AM

Answers

  • Hi Soumm,

    You should use the correct CATID for website projects and its folder and file items.

            [helpstring("WebSite Project browse object CATID")]        
            const LPWSTR prjCATIDWebSiteProjectBrowseObject = L"{EEF81A81-D390-4725-B16D-E103E0F967B4}";

            [helpstring("Web File browse object CATID")]        
            const LPWSTR prjCATIDWebFileBrowseObject =     L"{E231573C-C018-4768-A383-18B73F267E71}";

            [helpstring("Web Folder browse object CATID")]        
            const LPWSTR prjCATIDWebFolderBrowseObject =     L"{0A7F7E5E-5D30-41DD-9065-1A294D736F44}";

    Hope it helps.


    Hongye Sun [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    See what's happening in MSDN forum? Follow us at Twitter.
    Tuesday, January 26, 2010 4:57 AM
  • Hi soumm,

    Following are the solution related CATIDs:

    Solution: {A2392464-7C22-11d3-BDCA-00C04F688E50}
    Solution Folder: {292A5087-DF01-4e54-8EB2-C36CB3D6DE6C}

    Sorry that I don't find any CATID for solution items.


    Hongye Sun [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    See what's happening in MSDN forum? Follow us at Twitter.
    Wednesday, January 27, 2010 8:48 AM

All replies

  • Hi Soumm,

    You should use the correct CATID for website projects and its folder and file items.

            [helpstring("WebSite Project browse object CATID")]        
            const LPWSTR prjCATIDWebSiteProjectBrowseObject = L"{EEF81A81-D390-4725-B16D-E103E0F967B4}";

            [helpstring("Web File browse object CATID")]        
            const LPWSTR prjCATIDWebFileBrowseObject =     L"{E231573C-C018-4768-A383-18B73F267E71}";

            [helpstring("Web Folder browse object CATID")]        
            const LPWSTR prjCATIDWebFolderBrowseObject =     L"{0A7F7E5E-5D30-41DD-9065-1A294D736F44}";

    Hope it helps.


    Hongye Sun [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    See what's happening in MSDN forum? Follow us at Twitter.
    Tuesday, January 26, 2010 4:57 AM
  • Hello Hongye,

    That's quick and very cool. it works like a charm. thank you very much.

    On the similar lines, I find difficulty in displaying properties for Solution Folder and the items under it. Do I need to have specific CATIDs for the Solution folders as well?

    thanks again,
    soumm
    Wednesday, January 27, 2010 5:49 AM
  • Hi soumm,

    Following are the solution related CATIDs:

    Solution: {A2392464-7C22-11d3-BDCA-00C04F688E50}
    Solution Folder: {292A5087-DF01-4e54-8EB2-C36CB3D6DE6C}

    Sorry that I don't find any CATID for solution items.


    Hongye Sun [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    See what's happening in MSDN forum? Follow us at Twitter.
    Wednesday, January 27, 2010 8:48 AM
  • Thanks Hongye. unfortunately I couldn't make the Solution Folder CATID work. :-(

    whenever I select the Solution folder - I don't get the callback in CanExtend and GetExtender.

    - soumm
    Thursday, January 28, 2010 7:38 AM
  • Any item under the solution folder too behaves the same way - i.e - upon selection, the IDE doesn't make the callback.
    Thursday, January 28, 2010 7:40 AM
  • Hi soumm,

    I tested Solution Folder CatID in both VS 2005 and 2008 with success.

    The Solution Item has no CatID and therefore extender can't be used on it.


    Hongye Sun [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    See what's happening in MSDN forum? Follow us at Twitter.
    Monday, February 1, 2010 8:24 AM