How do I make the tool appear in the custom tool menu

Jan 26, 2013 at 5:19 AM

so I can use it?

Jan 27, 2013 at 5:20 PM

Do you mean in the properties Window like this? Currently you have to write it manually, but you only need to do it on one resw file which would be the default or fallback resource file.

I was thinking of creating an item template that automatically sets it, but for now you need to write it manually

Feb 3, 2013 at 12:45 AM
Yes. How does typing something in that box make the tool run? What associates "foo" or whatever else I type to this tool?
Feb 3, 2013 at 9:42 AM
Edited Feb 3, 2013 at 9:43 AM
Visual Studio has 3 language in which custom tools are supported. These are defined in the registry under a certain key, the name of the key is what you type under the Custom Tool field in the properties window of Visual Studio. The registry key contains values that describes the behavior of the custom tool and information that points to which class it should execute.

When the custom tool executes Visual Studio first loads the assembly (from Visual Studio 2012 and possibly all next versions the assembly must be in the GAC), if it can't load the assembly then Visual Studio will display an error message box. Once the assembly is loaded, it will invoke a method called Generate() and pass the file of which the custom tool was set together with the custom tool namespace (if this is not defined then it passes the default namespace defined in the project file appended with the folder structure in which the file to execute the custom tool is stored)

The custom tool is executed every time the file is changed or when the user explicitly says "Run custom tool" by right clicking on the file in the solution explorer

I hope that made sense...