none
Default Custom Tool for files of a specific extension.

    Question

  • Is it possible to configure the default Custom Tool for files with a specific extension? For example, I want any file with the extension .xmltocs to have use my single file generator 'GenerateCode'. I can't find a way to do this though.

    I see there is a way to set a default build action, but I can't seem to find a way to set a default Custom Tool

    Monday, May 03, 2010 7:29 PM

Answers

  • Hi Cameron,

    Thanks for your post.

    Based on my understanding, you want to always associate a custom tool with a specific extenstion. If so, Single File Generators are associated using the same reg key you use to register the generator. You need to create a following registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0
    \Generators\{pkgguid}\.xmltocs
    

    For more information, please refer to this thread:

    How to *always* associate a custom tool with a specific file extension?

    If I misunderstood you, or you have any comments, please feel free to let me know.

    Regards,

    Nancy Shao [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.
    Tuesday, May 04, 2010 5:42 AM

All replies

  • Hi Cameron,

    Thanks for your post.

    Based on my understanding, you want to always associate a custom tool with a specific extenstion. If so, Single File Generators are associated using the same reg key you use to register the generator. You need to create a following registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0
    \Generators\{pkgguid}\.xmltocs
    

    For more information, please refer to this thread:

    How to *always* associate a custom tool with a specific file extension?

    If I misunderstood you, or you have any comments, please feel free to let me know.

    Regards,

    Nancy Shao [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.
    Tuesday, May 04, 2010 5:42 AM
  • Am I correct to assume that the best way to add this is to use a pkgdef, rather than putting it directly in the registry?

    Thanks!!

    ~ Cameron

    Tuesday, May 04, 2010 12:23 PM
  • Am I correct to assume that the best way to add this is to use a pkgdef, rather than putting it directly in the registry?

    Thanks!!

    ~ Cameron

    Tuesday, May 04, 2010 12:24 PM
  • Hi Cameron,

    If you use VSPackage, it's better use a pkgdef. Or you can use Registry api to create a new subkey in the registry, such as RegistryKey class .

    Regards,

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


    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.
    Wednesday, May 05, 2010 2:15 AM