CLR notes: 2. Build, package, deploy, manage

Source: Internet
Author: User

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

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.