I had so much going on that I wasn't able to participate in NANY 2018, so I'm getting this app in extra early, for NANY 2019.Purpose
: The cpg.exe
program is a Windows command-line program that I developed because for several weeks now I've been writing a series of C# Console Programming tutorials on my local DokuWiki. Over the weeks, I've developed a pair of libraries, ioLibrary.cs and stringLibrary.cs, that I use frequently, almost with every new console program I create to illustrate a concept or test a new method. It became laborious copying the two libraries' response files to the new program's directory each time, creating a custom response file for the new program itself, and creating a batch file to call all three three response files against the csc.exe
command line compiler. Thus cpg.exe
was created to automate all of that.
It's very handy for me, personally. If anyone would like, I can further develop it so that it is library-agnostic and creates the simplest possible console program.Target Audience
: C# console programmers.
Unzip the download, and place folder csdev
at the root of C:\. Open an elevated
command prompt in the same directory (or open the elevated prompt and navigate to cpg.exe
is located in the /tools/ subdirectory. Run cpg.exe
(stands for c
enerator) and it will show you the use of its command-line syntax. Requires .NET Runtime.
Basically, the app is a Console Program Generator (hence, cpg
.exe). When you run it and supply a path/to/desired/directory/mypreferredfilename
as a argument, it will create a C# console source code file at the specified location and
Here's a screen shot of an executing test console app generated by cpg.exe
:My entry: A .NET Console Program Generator
The download should be extracted to your root drive on a Windows PC, i.e., C:\
That's where you should locate the /csdev/ folder after unzipping. Hey, I didn't know when I started this that I'd be sharing it,
so it's not very flexible as I coded it for my own use.
Currently, the program copies a couple of DLL libraries I wrote to the new source code file's directory. The library source code is included in the download. Also, when cpg.exe
writes the source
to c:\what\ever\path\filename, it inserts the relevant using
statements (equivalent of C++ includes), creates needed response files,and generates a batch file to make repetitive command line builds fast. The cpg
program itself has had ioLib.dll and strLib.dll merged with its own assembly via ILMerge tool.