// A simple C# application.
using System;
class TestApp
{
static void Main()
{
Console.WriteLine("Testing! 1, 2, 3");
}
}
Once you have finished, save the file in a convenient location (e.g., C:\CscExample) as
TestApp.cs. Now, let’s get to know the core options of the C# compiler.
■
Note
As a convention, all C# code files take a
*.cs
file extension. The name of the file does not need to have
any mapping to the name of the type (or types) it is defining.
Specifying Input and Output Targets
The first point of interest is to understand how to specify the name and type of assembly to create
(e.g., a console application named MyShell.exe, a code library named MathLib.dll, a Windows
Forms application named Halo8.exe, and so forth). Each possibility is represented by a specific flag
passed into csc.exe as a command-line parameter (see Table 2-1).
Table 2-1.
Output Options of the C# Compiler
Do'stlaringiz bilan baham: |