I will use IDE later. I will not use IDE later. I am really annoying ......
And, continue to the title party... I love Drag controls.
Let's get down to the truth and compile C # Through the command line. This time we will come back to play with IDE. This article mainly tells you about the customization capability of VS projects, it is not a dedicated product created by Microsoft. net and Win32 programming for beginners, but an excellent and scalable IDE product. You can use it to manage dependencies between projects and projects. It can be integrated with source code management tools. Compilation and execution are not limited to Microsoft's built-in centralized development language. You can even use it to develop Java.
This article will use a simple example to demonstrate how to use VS to compile ilasm. It should be of some practical use and be convenient for friends who like to study ilasm.
The first step is to create a C ++ Empty Project (yes, it is a C ++ empty project. For VS, VC ++ is a custom project, ).
Next, right-click the new project, select "tool generation sequence", and select all the C ++ tools, leaving only the custom generation tool.
So that our project won't be able to compile C ++.
Next, focus on opening the project file again in VS, right-click "Custom generation rules"
Then we create a new rule file to compile the il file.
After creating a rule file, you can easily create a rule.
Creating a rule is a little complicated. First let's take a look at the ILASM documentation: http://msdn.microsoft.com/zh-cn/library/496e4ekx (VS.80). aspx
I am only here to demonstrate that too many ilasm compilation options are not made into attributes.
After filling in the information, just make sure that you can. You can change the custom properties in the project to switch between exe and dll:
Add MSIL helloworld for verification:
Code
// HelloWorld. il
// This is our first IL program!
. Assembly extern mscorlib {
}
. Assembly HelloWorld {
. Ver 1: 0: 1: 0
}
. Module HelloWorld.exe
. Method privatescope static void Main () cel managed {
. Maxstack 1
. Entrypoint
Ldstr "Hello World"
Call void [mscorlib] System. Console: WriteLine (string)
Ret
}
The entire project package is attached:
/Files/winter-cn/ilasm.rar