Skip to main content

 C# Environment 


In this chapter, we will discuss the tools required for creating C# programming. We have already mentioned that C# is part of .Net framework and is used for writing .Net applications. Therefore, before discussing the available tools for running a C# program, let us understand how C# relates to the .Net framework.

The easiest way to get started with C#, is to use an IDE.

An IDE stands (Integrated Development Environment) is used to edit and compile the .Net code developed by Microsoft.

We can use of .Net framework to write the following types of application:-

  • Console Application
  • Windows Application
  • Web Application

IDE Install

We are using Visual Studio Software to develop the application which is support too many language such as C#, VB.Net, C++, Visual Basic, Jscript, COBOL, All these languages can access the framework as well as communicate with each other.

SO all the first we have need to install the software from its official Microsoft website.


Once the Visual Studio Installer is downloaded and installed, choose the .NET workload and click on the Modify/Install button:

After the installation is complete, click on the Launch button to get started with Visual Studio.

On the start window, choose Create a new project:

And you can choose type of application (Web, Windows from, Console application) from Visual studio interface.

After selecting the types of application Visual Studio will automatically generate some code for your project:

The code should look something like this:

Console Application Project Name: Program.cs

using System;

namespace HelloWorld
{
  class Program
  {
    static void Main(string[] args)
    {
      Console.WriteLine("Hello World!");    
    }
  }
}


on't worry if you don't understand the code above - we will discuss it in detail in later chapters. For now, focus on how to run the code.

Run the program by pressing the F5 button on your keyboard (or click on "Debug" -> "Start Debugging"). This will compile and execute your code. 





The .Net framework consists of an enormous library of codes used by the client languages such as C#. Following are some of the components of the .Net framework −

  • Common Language Runtime (CLR)
  • The .Net Framework Class Library
  • Common Language Specification
  • Common Type System
  • Metadata and Assemblies
  • Windows Forms
  • ASP.Net and ASP.Net AJAX
  • ADO.Net
  • Windows Workflow Foundation (WF)
  • Windows Presentation Foundation
  • Windows Communication Foundation (WCF)
  • LINQ
 


Comments