Call the C # compiler and IL Disassembly tool (ildasm) through the console)

Source: Internet
Author: User
ArticleDirectory
    • 1. Call the C # compiler through the console
    • 2. Call the Il Disassembly tool (ildasm) on the console)
1. Call the C # compiler through the console

You can directly call the C # compiler on the console to compile the snippet.CodeYou can also compile the source code without using Visual Studio. When calling the C # compiler through the console command line, we need to set the environment variable of the operating system in advance and add the following to the PATH variable:; C: \ WINDOWS \ Microsoft. NET \ framework \ v4.0.30319. Here I chose the C #4.0 compiler.

Now inE: \ CSHARPDirectoryTwo C # source files are stored. We compile them into DLL files and executable files respectively.Program(Exe ):

1.1 compile the program into an executable program (CSC filename. CS) through the command line)

The directory contains an executable file:

 

1.2 generate the DLL file through the command line (CSC/Target: Library filename. CS)

After compilation, a DLL file is generated in the directory:

 

2. Call the Il Disassembly tool (ildasm) on the console)

To call the ildasm tool through the console command line, we also need to set the environment variable of the operating system in advance and add the following to the PATH variable:; C: \ Program Files \ microsoft sdks \ windows \ v7.0a \ bin \ netfx 4.0 tools. After adding environment variables, we can call the ildasm tool anywhere.

The method for using the ildasm tool is similar to the method for calling the C # compiler,Enter ildasm in the console (assembly path | executable program path <EXE>.

Reference & extended reading

C # compilation options

Msil disassembly Program

Author:Sunny pig

Source:Http://www.cnblogs.com/IPrograming

The copyright of this article is shared by the author and the blog Park. You are welcome to repost this article. However, you must retain this statement without the author's consent and provide a clear link to the original article on the article page. Otherwise, you will be held legally liable.

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.