[Eclipse notes] Just for fun– to compile and run C # code under Eclipse

Source: Internet
Author: User
Tags new features
Notes | compiling


 





just for fun, let's look at an eclipse's C # plug-in, developed and maintained by a French company, improve technologies, which currently supports Eclipse 3.0 and. NET Framework 1.1.





first, we need to install the. NET Framework SDK and Eclipse on the local computer.





Next we download and install the plugin via Eclipse and an update site: Select Help-> Software Updates-> Find and Install in the Eclipse Workbench ..., select Search For the new features to install, select Next, click New Remote Site ..., enter a name and the following URL:





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




When the
point is complete, Eclipse begins loading the XML document and looking for relevant information. It should be noted that this site.xml actually contains the other plugins of improve technologies, which we do not need. In the next search results page, we only use the check C sharp entry. If you choose to finish later, Eclipse will start installing the plugin and will be prompted to restart Eclipse when you are done.




After
to restart Eclipse, we make some final configuration. With Window-> Preferences Open, we can see the new C # Preferences, where you can specify the C # compiler type and location, such as: C:\WINDOWS\Microsoft.NET\Framework\ V1.1.4322\csc.exe





is done, let's try a test.





Create a new blank item, select New-> other in the project, or use the shortcut key CTRL + N to choose C # Directory of C # file, and enter some test code to save the file, and then the default will automatically compile it, we can Csharpconsoleview See compiler information, if all goes well, in our project directory will come out of an EXE file, double-click this exe file, our C # program can run up. Supplemental Note: We can right key CS file, select Properties (Alt + Enter) to specify the output file type and other command-line parameters.





This plug-in implementation is actually quite limited, basically just take advantage of the existing compiler, and then simplify some of the operations, and then some syntax highlight functions, and even the combination of compiler do some code-level simple error tips. But it's an interesting plugin.





the code I used as the test is as follows:


using system;namespace mainnamespace {       public  class mainentry {               public static void main ()  {                      // Add your code  here                      console.writeline ("To test c# plugin in eclipse");                       for  (int i = 0; i < 10; i ++ )  {                           &Nbsp;  console.writeline (" # "  + i +  " # ");                       }                      console.readline ();               }      &NBSP}}


Just for fun.





Use this plug-in to do some simple verification and thinking of sorting is possible, if you really want to choose 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.