Use the CSC command to compile the. CS file into. dll

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.