2.1. NET Framework Deployment targets
Problems with non. NET programs:
1.DLL Hell
2. Installation is complex. Directory scatter, registry, shortcuts
3. Safety. Download malicious code silently
2.2 Integrating types into modules--compiler tool CSC
Csc/out:program.exe/t:exe/r:mscorlib.dll Program.cs
Because C # will automatically reference Mscorlib.dll, you can omit/r:mscorlib.dll
C # Default Build exe (CUI), so/t:exe can omit; DLLs (Assembly/t:library) and GUI (visual application/t:winexe) cannot be omitted
C # is compiled into Program.exe by default, so/out:program.exe can omit
Finally streamlined to:
CSC Program.cs
If you do not want the default reference Mscorlib.dll, use the/nostdlib switch
Csc/nostdlib Program.cs
Note:/t can be written as/target,/r can be written as/reference
/reference: Specifies the referenced DLL, you can use the full path, or if it is incomplete, look in the following directory:
1. Working directory (the CS file to be compiled)
2. System catalog (csc.exe location)
The directory specified by the 3./lib switch
4.LIB system Variable specified directory
Answer files (Response file)
Includes a series of compiler command-line switches that are opened when the CSC is executed, such as the following text in MYPROJECT.RSP:
/out:program.exe
/t:exe
/r:mscorlib.dll
Then the call is as follows: csc @MyProject. RSP Program.cs
The location of this answer file, when running the CSC command, first locate the current directory (where Program.cs is located), and then find it in the system directory (where the csc.exe is located), and if so, whichever is the former
Use the/noconfig switch to specify that RSP files are ignored