Search code examples
.netvisual-studio-2012customtool

Is it possible to make a file association with a customtool in Visual Studio?


I've created a customtool for VisualStudio. Now I was wondering if it was possible to make a file association so when I create certain type of file (*.popo), it would automatically set the property field for the customtool?

Example: When you create a resx, the 'GlobalResourceProxyGenerator' is autonatically set for it. and then generate the file.

Thanks,


Solution

  • You can create a custom file template in Visual Studio. If needed you can implement the IWizard interface to set additional properties that are not supported by the template file format. Setting the customtool is something that can easily be done using the IWizard interface, see the related question for a code sample.

    That way you can have your .popo file in the Add New Item window of Visual Studio and have it set all the properties you want when creating a new file.