[Eclipse Notes] Just for fun-compile and run C # code in eclipse

Source: Internet
Author: User

 

Just for fun, let's look atEclipseOfC #Plug-in, a French companyImprove TechnologiesDevelopment and maintenance, currently supportedEclipse 3.0And. NET Framework 1.1.

First, we need to install. NET Framework SDKAndEclipse.

Next we will go through Eclipse And one Update site To download and install the plug-in: Eclipse Workbench Selection Help-> Software Updates-> Find and install... , Select Search for new features to install , Select next, and click New remote site... , Enter a name and the following URL :

Http://www.improve-technologies.com/alpha/updates/site.xml

Click Finish. Eclipse Load the above XML Document and find relevant information. Note that Site. xml Actually Improve Technologies Other plug-ins, we do not need. In the following Search results Page, we only select C sharp . After selection Finish At this time Eclipse The plug-in will start to be installed. After the plug-in is installed, the system will prompt whether to restart. Eclipse , Select YES.

RestartEclipseThen, we make some final configuration. OpenWindow-> preferences, We can see the newly addedC # preferences, You can specifyC #Compiler type and location, such:C: \ windows \ Microsoft. NET \ framework \ v1.1.4322 \ csc.exe

Let's test it.

Create a blank project and select New-> Other Or use the shortcut key CTRL + n , Select C # Directory C # File Create a new C # File, enter some testsCode, Select Save. The file will be automatically compiled by default. We can % Csharpconsoleview See the compiler information, if everything goes well, in our Project One more EXE File, double-click this EXE File, our C # ProgramYou can run it. Note: Right-click CS File, select Properties ( Alt + enter ) To specify the output file type and other command line parameters.

The functions implemented by this plug-in are actually quite limited, basically only by using the existingCompilerAnd then simplify some operations.Syntax highlightFunctions, even combinedCompilerSome simple code-Level Error prompts were made. But it is an interesting plug-in.

The code I used for testing is as follows:

Using System;

Namespace Mainnamespace {

Public   Class Mainentry {

Public   Static   Void Main () {
// Add your code here
Console. writeline ( " To test C # plugin eclipse " );
For ( Int I =   0 ; I <   10 ; I ++ ) {< br> console. writeline ( " # " + I + " # " );
}
Console. Readline ();
}

}

}

Just for fun.

You can use this plug-in to do some simple verification and train of thought arrangement. If you really want to select a free C # IDE for development, I think I will consider sharpdevelop.

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.