Installing C# on Windows XP

Preliminary Notes

Some details in these instructions are specific to Windows XP. Installation on other Windows systems (2000, NT, ME ...) will be similar but may differ in some details.

You will need Administrator privileges to complete the steps listed here.

The C# compiler, which can be invoked from a command window, is included free with the Microsoft .Net Framework SDK. If you also require an interactive development environment (IDE) to use with the C# compiler, some additional help is provided below.

Installing the .Net Framework

Two separate downloads from Microsoft are required.

Step 1.

First, install the .NET Framework Redistributable. There are two versions available. Version 1.1 is the version which corresponds to the book. It can be found at this URL:

Version 2.0 is the newest version. It supports several additions to the C# language which are not described in the book. However, all the book's programs work unchanged with version 2.0 and there is no reason not to install it. Version 2.0 can be downloaded from this URL:

You should save the downloaded file on your system and execute it.

Step 2.

Second, install the .NET Framework SDK. Again, there are two version, 1.1 and 2.0. If you chose Version 1.1 for step 1, above, you will need to install version 1.1 of the SDK. It can be found at this URL:

If you chose version 2.0, you can download the SDK version 2.0 from this URL:

Again, save the downloaded file and execute it.

Step 3.

Once you have completed the two installs, you will have the Microsoft .Net Framework and the SDK (Software Development Kit) for .Net on your computer. The SDK installation includes the C# compiler. It will exist as a file named csc.exe. If you have accepted all the defaults for the installation, it will be located in a folder with a name similar to C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 or to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 (depending on which version of the .NET Framework was installed) where the trailing four or five digit number may be different if there has been a recent minor upgrade. If necessary, you can use the Search command under the start menu to locate the folder which contains the file named csc.exe.

Assuming the folder paths given above, the C# compiler can be invoked in a command-line window by typing one of the commands:
  C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc filename.cs
  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc filename.cs
where filename.cs is the C# source code file to be compiled.

To make command-line usage more convenient, you can add the folder name to the end of the PATH environment variable. On Windows XP, the PATH variable is accessed from the System control panel:

  1. Open the Control Panel folder from the start menu.
  2. Open the System control panel, [In the Category View of the Control Panel folder, you will find it in the Performance and Maintenance section; with the Classic View of the Control Panel folder, it is right there.]
  3. Select the Advanced tab, and click on the Environment Variables button.
  4. In the User Variables list of environment variables, highlight the PATH variable and click edit. [If PATH does not appear in the list then click the New button, enter the name PATH as the variable name, enter the path to the folder as the Variable value, and ignore step 5 below.]
  5. Use the arrow key to get to the right-hand end of the string which is the Variable value; then type a semicolon followed by the path to the folder where csc.exe is located.
  6. Click OK for the PATH variable setting, click OK for the Environment Variables panel, and exit from the System control panel.
Once the PATH variable has been updated, you can open a new command window and the simple command
  csc filename.cs
should now work.

Interactive Development Environments

You can use any text editor, including NotePad and EditPad, to create and edit C# files. You just have to give the filenames the .cs extension instead of the default .txt extension. The EditPad editor is available from this URL:

You can use a combination of a text editor and an open command window. (A command window can be opened by typing the word cmd in the Run... dialog box found in the start menu.)

For developing and debugging large C# programs, an interactive development environment (or IDE) is recommended.

Here are some possibilities.
  Visual Studio 2005 This is the standard IDE from Microsoft. However it costs money, and it has a large memory footprint. Students and faculty at educational institutions enrolled in the MSDNAA (Microsoft Developer Network Academic Alliance) can obtain copies of Visual Studio 2005 at no additional cost. Instructions for downloading and installing MSDNAA software should be obtained through your educational institution.
  #develop #develop (pronounced sharp develop) is an IDE for C# which is open source and therefore free. It is entirely programmed in C# itself and runs in the Windows .Net environment. Both the executable and the source code may be downloaded from the following URL:
  Eclipse Eclipse is a generic IDE, usable for several programming languages, which requires that a separate C# plugin be downloaded. Eclipse may be downloaded from this URL:   Eclipse is a large Java program (about 115MB); your system must therefore also have the Java run-time environment installed. A C# plugin is available as    Improve C# editor
  Antechinus This is a C# Editor with simple IDE features. It is available from this URL for US$49.95:
It has to be purchased.