Getting C


Getting C#

The first step in building C# applications is making sure that you have the C# compiler installed in your machine. There are two ways to ensure that. One way is to install Visual Studio .NET from the Visual Studio .NET CDs. The setup program will first install the .NET Framework. (The .NET Framework includes the C# compiler csc.exe.) If you don't have the Visual Studio .NET CDs, you can download and install the .NET Framework for free from Microsoft.com.

To download and install the .NET framework:

  1. Install Internet Explorer (IE) 5.5 or higher. Using your browser, navigate to the download area for Internet Explorer. The IE download section is at www.microsoft.com/ windows /ie/default.asp ( Figure 1.1 ).

    Figure 1.1. The .NET Framework requires Internet Explorer 5.5 or higher. If you're running Windows 2000, you may need to download the latest version of IE from Microsoft.

    graphics/01fig01.jpg

  2. Install Internet Information Services (IIS). (See "Installing Internet Information Services (IIS)" later in this chapter.)

  3. Using your Web browser, navigate to the .NET download section. The .NET Framework download section is at msdn.microsoft.com/netframework/downloads/howtoget.asp ( Figure 1.2 ).

    Figure 1.2. The .NET Framework SDK gives you enough tools to compile, run, and debug .NET applications, including ASP .NET pages. It doesn't provide a nice editor the way Visual Studio .NET does.

    graphics/01fig02.jpg

  4. Click the "Get the .NET Framework SDK" link.

  5. Click the "Full SDK Download" link ( Figure 1.3 ).

    Figure 1.3. The .NET Framework is a free download. You could also download the redistributable runtime if you only need the files necessary to run .NET programs but not to write them.

    graphics/01fig03.jpg

  6. You will see a license agreement dialog. Click Yes to proceed if you agree with the licensing conditions ( Figure 1.4 ).

    Figure 1.4. Does anyone ever read these things?

    graphics/01fig04.jpg

  7. After you click Yes, the browser will display the standard download dialog that asks if you wish to save or open the program. Choose Save or Open . If you choose Save, look for setup.exe in the download directory and run it.

  8. Follow the directions of the setup program.

Running .NET Applications

You're now ready to write .NET applications with C#. The next question is, what do people need in their machines to run your .NET applications? Of course, any machine that has the .NET Framework SDK, or Visual Studio .NET, installed can run .NET programs. But what about machines that don't have or want any trace of the .NET development tools? Microsoft provides a program called dotnetredist.exe. It is known as the .NET Runtime Redistributable. When you run this program on a client machine, it installs the files necessary to run .NET applications. You can install the .NET runtime (not the SDK) in any flavor of Windows. To get dotnetredist.exe you can download it from the .NET download section. In fact, the download page for the redistributable is the page displayed after step 4 in the instructions above.

graphics/tick.gif Tips

  • The .NET Framework SDK includes the C# compiler, csc.exe (as well as other .NET compilers such as the Visual Basic .NET compiler, vbc.exe), and a visual debugger, dbgclr .exe. The only thing missing is a nice editor with intellisense, like Visual Studio .NET. (Intellisense is a Microsoft feature in the editor that displays choices for class names and function names as you type.)

  • The SDK is enough for you to build ASP .NET applications and stand-alone C# applications, but you will need to use a text editor to edit the code (notepad.exe is sufficient.), or one of the many thirdparty code editors. You can download a free editor called Web Matrix to build ASP .NET applications from www.asp.net/webmatrix/download.aspx

  • To install the .NET Framework SDK or Visual Studio .NET you must have Windows NT 4.0 (Service Pack 6a required), Windows 2000, or Windows XP Professional. These operating systems are sufficient to develop C# stand-alone or C# Windows Forms applications. To write ASP.NET applications you can't use Windows NT 4.0. You must have Windows 2000 or Windows XP Professional or higher.




C#
C# & VB.NET Conversion Pocket Reference
ISBN: 0596003196
EAN: 2147483647
Year: 2003
Pages: 198
Authors: Jose Mojica

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net