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: WINDOWSMicrosoft. switch NETFrameworkv1.1.4322 to the directory where vs.net is installed-> execute the csc command csc/target: library File. cs-> Generate a corresponding name under this directory. dll file (premise: Put. put the cs file in C: WINDOWSMicrosoft. NETFrameworkv1.1.4322 directory)
Csc commands are used in many ways. refer to the following,
------------------------------------
Translate 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 the C # files in the current directory to generate the debug version of 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. another way of writing cs 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. It is useful to install two cs files into A. dll file.