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.