Compilation of C #

Source: Internet
Author: User

Compilation on Windows

1: First configure the C:\Windows\Microsoft.NET\Framework\v3.5 to the path of the system environment variable.

2: Write C # code

demo1.txt

Using System;namespace helloworld{   class program   {        static void Main (string[] args) {            Console.WriteLine ("Hello world!");            Console.readkey ();}}}    

demo2.txt

Using system;using System.Windows.Forms; Static class classapp{    static void Main () {        Application.Run (new Form ());}    }

3: Then open CMD,CD to TXT file in the same directory as enter the following command

csc /out: demo1.exe demo1.txt

csc /out: demo2.exe demo2.txt

Linux compilation (ubuntu12.04 For example, I will do this)

1. Use the terminal, Ctrl+alt+t, or file system to search for terminal
2. View disk information df-h
3.http://download.mono-project.com/sources/mono/Selecting the Mono version
Example
Cd/downloads
wget http://download.mono-project.com/sources/mono/mono-3.0.6.tar.bz2//download
TAR-JXVF mono-3.0.6.tar.bz2//Decompression
CD mono-3.0.6//Enter directory
./configure--PREFIX=/USR Configuration Directory
Make//Compile
Make Install//install

1. Open the terminal and go to the appropriate directory

2.

mcs test.cs

Then there will be a test.exe in the catalogue.

Run mono Test.exe to run

Compilation of C #

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.