In many cases, we need to compile the. CS file into a. dll file separately,
The procedure is as follows:
Open the command window-> Enter cmd to the console-> Cd
C: \ windows \ microsoft. Net \ framework \ v1.1.4322 go to the directory where vs.net is installed-> execute the CSC command
/Target: Library
File. CS-> Generate a. dll file with the corresponding name under this directory (premise: Put the. CS file in the c: \ windows \ Microsoft. NET \ framework \ v1.1.4322 directory)
CSC commands are used in many ways. refer to the following,
------------------------------------
Translation
File. CS to generate file.exe:
CSC file. CS
Compile file. CS to generate file. dll:
CSC
/Target: library file. CS
Compile file. CS and create my.exe:
CSC/out: my.exe
File. CS
Compile all C # files in the current directory by optimizing and defining the debug symbol. Output is file2.exe:
CSC
/Define: Debug/optimize/out: file2.exe *. CS
Compile all C # files in the current directory to generate file2.dll
. No logo or warning is displayed:
CSC/Target: Library/out: file2.dll/warn: 0/nologo/debug
*. CS
Compile all the C # files in the current directory as something. XYZ (a DLL ):
CSC/Target: Library
/Out: Something. XYZ *. CS
Compile file. CS to generate file. dll: CSC/Target: Library
File. CS is the most widely used command. In fact, it can be simply written as CSC/T: library file. cs. Another way of writing is
CSC
/Out: mycodebehind. dll/T: Library mycodebehind. cs. You can specify the output file name by yourself.
CSC
/Out: mycodebehind. dll/T: Library mycodebehind. CS
Mycodebehind2.cs. This function is to install two Cs files into A. dll file, which is very useful.