Multiple EXEs from one C# project
I am developing a set of command line utilities that are very small using C#. For example, I have one application that just prints a line from a config file specified in the PATH variable.
Currently I have one project called utilities under my solution. I was wondering is there was a way to produce multiple exe files from one project. I am looking to do this because there will be about 10 different utilities and I since I already have 6 projects under my solution, I don't want to clutter it any further.
I would expect to be able to have one开发者_如何学JAVA main function for each executable to be compiled and specify those in different namespaces.
Thanks for your help!
Maybe you just want to add a solution folder, and put all the utility projects into it?
you can share the common code in a class library so you do not have to write it multiple times. Then for each small command line application (executable) you want to create you add a windows console application to the solution.
this is the viable way in my opinion, not aware if you can configure Visual Studio to create many executables from the same sources. Could be you could get it playing around with solution and project configuration but it sounds hacky to me.
You could pass in parameters to the console executable to run each utility function:
utility.exe /command=writeline /message="This is a test"
I like using this command line parser: http://www.codeproject.com/KB/recipes/command_line.aspx
精彩评论