C # is a great programming language, and all the tools you need to get started is free and easy to use. While C # is often associated with Microsoft and closed source by everyone, free software advocates simply use DotGNU, which provides more or less the same basic functionality and allows you to explore and modify the kernel without any restrictions. The instructions below describe both the FOSS-centric approach and the Windows-centric one. C # also works with the. NET framework.
Steps
Method 1 of 3: Configure (Windows)

Step 1. Go here to download a free copy of Visual C # 2010 Express Edition
A 2012 version is also available, but download the 2010 version better if you are looking for general C # development.
The 2012 version also does not support Windows 7/8

Step 2. Run the downloaded executable file and follow these steps
- Further.
-
Create a Program in C Sharp Step 2 - I agree → Next.
-
Create a Program in C Sharp Step 2 - Select MSDN, not SQL → Next.
-
Create a Program in C Sharp Step 2 - Install.
-
Create a Program in C Sharp Step 2
Method 2 of 3: Create your first program

Step 1. Start Visual C # 2010 Express Edition

Step 2. Click File → New → Project

Step 3. Select Visual C # → Windows → Console Application

Step 4. Click OK
You should see the following:
using System; using System. Collections. Generic; using System. Text; namespace ConsoleApplication1 {class Program {static void Main (string [] args) {}}}

Step 5. Under static void Main (string [] args) and after the first curly brace, type in the following
Console. WriteLine ("Hello, World!"); Console. ReadLine ();

Step 6. The result should look something like this
using System; using System. Collections. Generic; using System. Text; namespace ConsoleApplication1 {class Program {static void Main (string [] args) {Console. WriteLine ("Hello, World!"); Console. ReadLine (); }}}

Step 7. Click the "Run" [►] button on the toolbar
Congratulations! You've just created your first C # program!

Step 8. This program should bring up a console window that says “Hello World
».
-
If this is not the case, then you are mistaken somewhere.
Method 3 of 3: Setting Up (Freeware)
6593 10 Step 1. You will need CVS and GNU compilers
They are included in most Linux distributions.
6593 11 Step 2. Visit the site of the DotGNU project (http://www.gnu.org/software/dotgnu/), which provides the FOSS implementation of C #
Read the chapter on installation. Even beginners can easily follow these instructions.
6593 12 Step 3. You can either select the sources and build your own C # development environment from scratch, or try out the pre-compiled distributions first
The project is fairly easy to create from source, so we recommend that you try this path first.
6593 13 Step 4. Try to run a few examples that are already compiled (.exe)
For example, FormsTest.exe will show a large collection of different GUI controls. The pnetlib / samples folder contains the ilrun.sh script capable of running compiled executables like this: sh./ilrun.sh forms / FormsTest.exe (from the same folder).
6593 14 Step 5. On Linux, you can use KWrite or gedit to edit C # code
Recent versions of both editors support syntax highlighting for this language.
6593 15 Step 6. Learn how to compile the short example described in the Windows section
If there is not enough documentation on the project website, search the Internet. If it doesn't help, ask a question on the project website.
6593 16 Step 7. Congratulations, now you know about two types of C # code implementation and are not tied to any one C # provider
Advice
- When you install Visual C # 2010/2012 express, it will either download automatically or ask you for permission.
- Visual C # 2005/2008 Express Editions comes with the option to install Microsoft MSDN 2005 Express Edition. This is great help and can be accessed through Help: Contents or by highlighting a keyword and pressing F1. It is highly recommended to download and install the MSDN library.
- There are better C # implementations than those described here. The Mono project might interest you.
Recommended Books
- ISBN 0-7645-8955-5: Visual C # 2005 Express Edition Starter Kit - Newbie
- ISBN 0-7645-7847-2: Beginning Visual C # 2005 - Novice
- ISBN 0-7645-7534-1: Professional C # 2005 - Intermediate +