Running the Compiler Manually


One of the programs included in the .NET SDK is the C# command-line compiler, csc.exe. ASP .NET uses csc.exe to compile your Web pages into DLLs when the client requests them for the first time from the browser. But you can also write stand-alone applications with Visual Studio .NET or with the text editor of your choice, then run the C# command-line compiler manually to produce an executable.

Using the command-line compiler:

  1. If you installed Visual Studio .NET, choose Start >All Programs > Microsoft Visual Studio .NET > Visual Studio .NET Tools > Visual Studio .NET Command Prompt.

    or

    If you installed the .NET Framework SDK (and not Visual Studio .NET), choose Start > All Programs > Accessories > Command Prompt.

  2. From the command prompt type: csc.exe /? .

graphics/tick.gif Tips

  • The name of the C# compiler is csc.exe.

  • If you run csc.exe /? , the program tells you all the command line options you can use with the compiler ( Figure 1.27 ). For an example of some of the most important options see "Compiling and Executing a C# Program" later in this chapter.

    Figure 1.27. Running csc.exe /? makes the compiler display the list of command line parameters for the compiler. For example /t specifies the target type: exe for console, winexe for a Windows Form application, library to create a DLL, and module to create a compiled file that can be combined with other modules to make an assembly.

    graphics/01fig27.jpg




C#
C# & VB.NET Conversion Pocket Reference
ISBN: 0596003196
EAN: 2147483647
Year: 2003
Pages: 198
Authors: Jose Mojica

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net