IDE for Building C# Applications

If .NET Core or .NET Framework are installed on PC, simple editor like Notepad is enough to build and RUN the C# application. But it needs lot of manual setups and steps. Which is not an easy task for the a beginner. It is not only difficult but also waste lot of time.

But Microsoft provides two one of the most wonderful and beautiful IDEs for building .NET applications. These are lovable and most perfect IDEs around the software development world. These includes Visual Studio Code and Microsoft Visual Studio IDE.

Both IDEs can be easily downloaded from the official website https://visualstudio.microsoft.com/

1. Visual Studio Code.

Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages (such as C++, C#, Java, Python, PHP, Go) and runtimes (such as .NET and Unity)




1. Visual Studio IDE 2019.

Latest reslease of the Visual Studio IDE is 2019 hence called as Visual Studio 2019. Visual Studio 2019 is wonderful and complete IDE for building any kind of the application using .NET. VS 2019 is a full-featured integrated development environment (IDE) for Android, iOS, Windows, web, and cloud.

There are three version of the VS 2019 called Community,Professional, and Enterprise.These are avaialbe at https://visualstudio.microsoft.com/downloads/

In this tutorial we will use Visual Studio and Visual Studio Code for demonstrations of the Examples for the better understanding of the C# as a Language.

Development Environment

In order to develop and run C# program we need to download and install .NET Runtime and .NET SDK from the official Microsoft Website  https://dotnet.microsoft.com/download

.Net Core (Which includes .NET Core Runtimes and .NET Core SDK).

.NET Core is a cross-platform version of .NET for building websites, services, and console apps.
.NET Core can installed on any of the WINDOWS,LINUX and macOS operating systems

                                                                        OR


.NET Framework (which also incluse .NET Framework Runtime and .NET Framework Dev Pack)


.NET Framework is a Windows-only version of .NET for building any type of app that runs on Windows.

Below images of the official website (https://dotnet.microsoft.com/download) of the Microsoft tells the whole story , how to download the .NET and builds any application based on .NET platform.






.NET is free. There are no fees or licensing costs, including for commercial use.

.NET is open-source and cross-platform, with free development tools for Windows, Linux, and macOS.

.NET is supported by Microsoft. Microsoft ships official releases that are built and tested on Microsoft-maintained servers in Azure and supported just like any Microsoft product.


Please note that with the installation of Microsoft VS 2019 both .NET Framework and .NET Core are automatically installed on Machine. 






Introduction to C-Sharp (C#. 8.0)

C# is an elegant and type-safe object-oriented language that enables developers to build a variety of secure and robust applications that run on the .NET Framework. You can use C# to create Windows client applications, XML Web services, distributed components, client-server applications, database applications, and much, much more. Visual C# provides an advanced code editor, convenient user interface designers, integrated debugger, and many other tools to make it easier to develop applications based on the C# language and the .NET Framework.

C-Sharp (C#) Language


C# syntax is highly expressive, yet it is also simple and easy to learn. The curly-brace syntax of C# will be instantly recognizable to anyone familiar with C, C++ or Java. Developers who know any of these languages are typically able to begin to work productively in C# within a very short time. C# syntax simplifies many of the complexities of C++ and provides powerful features such as nullable value types, enumerations, delegates, lambda expressions and direct memory access, which are not found in Java. C# supports generic methods and types, which provide increased type safety and performance, and iterators, which enable implementers of collection classes to define custom iteration behaviors that are simple to use by client code. Language-Integrated Query (LINQ) expressions make the strongly-typed query a first-class language construct.

As an object-oriented language, C# supports the concepts of encapsulation, inheritance, and polymorphism. All variables and methods, including the Main method, the application's entry point, are encapsulated within class definitions. A class may inherit directly from one parent class, but it may implement any number of interfaces. Methods that override virtual methods in a parent class require the override keyword as a way to avoid accidental redefinition. In C#, a struct is like a lightweight class; it is a stack-allocated type that can implement interfaces but does not support inheritance.

In addition to these basic object-oriented principles, C# makes it easy to develop software components through several innovative language constructs, including the following:

Encapsulated method signatures called delegates, which enable type-safe event notifications.

Properties, which serve as accessors for private member variables.

Attributes, which provide declarative metadata about types at run time.

Inline XML documentation comments.

Language-Integrated Query (LINQ) which provides built-in query capabilities across a variety of data sources.

If you have to interact with other Windows software such as COM objects or native Win32 DLLs, you can do this in C# through a process called "Interop". Interop enables C# programs to do almost anything that a native C++ application can do. C# even supports pointers and the concept of "unsafe" code for those cases in which direct memory access is absolutely critical.

The C# build process is simple compared to C and C++ and more flexible than in Java. There are no separate header files, and no requirement that methods and types be declared in a particular order. A C# source file may define any number of classes, structs, interfaces, and events.

.NET Framework Platform Architecture

# programs run on the .NET Framework, an integral component of Windows that includes a virtual execution system called the common language runtime (CLR) and a unified set of class libraries. The CLR is the commercial implementation by Microsoft of the common language infrastructure (CLI), an international standard that is the basis for creating execution and development environments in which languages and libraries work together seamlessly.

Source code written in C# is compiled into an intermediate language (IL) that conforms to the CLI specification. The IL code and resources, such as bitmaps and strings, are stored on disk in an executable file called an assembly, typically with an extension of .exe or .dll. An assembly contains a manifest that provides information about the assembly's types, version, culture, and security requirements.

When the C# program is executed, the assembly is loaded into the CLR, which might take various actions based on the information in the manifest. Then, if the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code to native machine instructions. The CLR also provides other services related to automatic garbage collection, exception handling, and resource management. Code that is executed by the CLR is sometimes referred to as "managed code," in contrast to "unmanaged code" which is compiled into native machine language that targets a specific system. The following diagram illustrates the compile-time and run-time relationships of C# source code files, the .NET Framework class libraries, assemblies, and the CLR.

Language interoperability is a key feature of the .NET Framework. Because the IL code produced by the C# compiler conforms to the Common Type Specification (CTS), IL code generated from C# can interact with code that was generated from the .NET versions of Visual Basic, Visual C++, or any of more than 20 other CTS-compliant languages. A single assembly may contain multiple modules written in different .NET languages, and the types can reference each other just as if they were written in the same language.


In addition to the run time services, the .NET Framework also includes an extensive library of over 4000 classes organized into namespaces that provide a wide variety of useful functionality for everything from file input and output to string manipulation to XML parsing, to Windows Forms controls. The typical C# application uses the .NET Framework class library extensively to handle common "plumbing" chores.


 Use the .NET Framework to develop the following types of apps and services:

  • Console apps. See Building Console Applications.
  • Windows GUI apps (Windows Forms). See Windows Forms.
  • Windows Presentation Foundation (WPF) apps. See Windows Presentation Foundation.
  • ASP.NET apps. See Web Applications with ASP.NET.
  • Windows services. See Introduction to Windows Service Applications.
  • Service-oriented apps using Windows Communication Foundation (WCF). See Service-Oriented Applications with WCF.
  • Workflow-enabled apps using Windows Workflow Foundation (WF). See Windows Workflow Foundation.