Visual Studio is not just used to drag controls

Source: Internet
Author: User
Tags mscorlib

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

 

 

Related Article

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.