The C# Command-Line Compiler (csc.exe)
There are a number of techniques you may use to compile C# source code. In addition to Visual
Studio 2005 (as well as various third-party .NET IDEs), you are able to create .NET assemblies using
the C# command-line compiler, csc.exe (where csc stands for C-Sharp Compiler). This tool is included
with the .NET Framework 2.0 SDK. While it is true that you may never decide to build a large-scale
application using the command-line compiler, it is important to understand the basics of how to
compile your *.cs files by hand. I can think of a few reasons you should get a grip on the process:
• The most obvious reason is the simple fact that you might not have a copy of Visual Studio
2005.
• You plan to make use of automated build tools such as MSBuild or NAnt.
• You want to deepen your understanding of C#. When you use graphical IDEs to build applications,
you are ultimately instructing csc.exe how to manipulate your C# input files. In this
light, it’s edifying to see what takes place behind the scenes.
Another nice by-product of working with csc.exe in the raw is that you become that much
more comfortable manipulating other command-line tools included with the .NET Framework 2.0
SDK. As you will see throughout this book, a number of important utilities are accessible only from
the command line.
Monday, February 23, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment