Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I'm working on a tool that will generate some C# code, which I hope could prove useable to a wider audience. This tool will read an assembly and a text file containing some data and then generate a bunch of C# classes.

The easiest way to do this is of course to simply create a console exe that can be associated with the file type, in the same vein as the code generation tool for XSD files. But I fear that this will be a bit difficult to integrate. I'd much rather have something that feels better integrated. I'll still make the console app anyway, since it's practically a free byproduct and it might be useful for continuous integration.

The assembly in question will typically be the current assembly that will be generated when the code is compiled, which I suspect normally also will be the assembly where you want the generated files to be hosted.

Is there a way of making these kinds of tools? Am I looking into writing a visual studio extension just for this?

If the simple exe version is the way to go, is there any way to make it easier on the user by offering installation help along the way, to make it as easy as possible.

share|improve this question

closed as too broad by MichaelT, Snowman, durron597, GlenH7, enderland Jul 22 at 20:45

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs. If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

Is there a way of making these kinds of tools? Am I looking into writing a visual studio extension just for this?

Personally, I don't favor command line console applications for Windows. Unix people are used to it but many Windows developers that I have seen don't fancy them.

Either your tool will present a list of assemblies for the user to select from, or ask the user to enter an assembly name or be run within VS environment itself as an add-on. For the first 2 options, you better have a GUI interface and you probably use WPF or Windows Forms. However, if you choose option 3, VS 2010 allow for extensibility (as well other previous versions). Please visit Extend MSDN where you will find very good relevant information. The book Professional Visual Studio Extensibility may also help.

share|improve this answer
The ideal way would be if it would use the same assembly as the one that contains the script file. If you say right click on the script file, it would use the last built assembly and regenerate the classes. That would probably require an extension though. –  Dervall Mar 17 '12 at 12:13
OK, but what would the user be doing (or looking at) before running your tool? –  Emmad Kareem Mar 17 '12 at 12:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.