What is .NET?

.NET is a framework of Microsoft, it has 2 main components:

– CLR Common Language Runtime, the engine to run the application
– .NET libraries of classes

The main features are:

– Memory management, not manual memory allocation needed
– Common Type System
– Extended libraries of classes, ready and easy to use
– Specialized libraries as ASP.NET for the web
– CIL Common Intermediate Language, to exchange routines among diffent languages
– Multiplatform support, Win7-10, Win Phone, Xbox

Last but not least, Unity (C#) and Unreal (C++) game engines join the .NET foundation.

To develop using .NET you need the development environment ‘Visual Studio’

Installation

0. Disable the realtime protection of your antivirus and disable Windows Update

1. Install Visual Studio Community https://www.visualstudio.com/it/downloads/
In the package you will have the development environment and the .NET framework included

The application will be installed at C:\Programmi (x86)\Microsoft Visual Studio 14.0

The most popular tools and languages supported are:

– Visual C++
– Visual F#
– Python
– Microsoft SQL
– Silverlight
– Win 10 SDK
– C#
– HTML/Javascript
– Android Visual C++
– iOS Visual C++
– Android SDK
– Apache Ant
– Java SE
– Node.js
– GitHub

2. Take your time, installation + update can take some hours…

Hello World

1. Run Visual Studio

2. File> New project, select ‘C# windows Form Application’ and give it a name.
I name it ‘WindowsFormsApplication-Test1’

3. On the right column select Program.cs and you will see the code:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication_Test1
{
    static class Program
    {
        /// <summary>
        /// Punto di ingresso principale dell'applicazione.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }// END Main()
    }// END class Program
}// END namespace

4. F5 to run the project

References:
https://msdn.microsoft.com/it-it/library/hh425099(v=vs.110).aspx
https://msdn.microsoft.com/it-it/library/k1sx6ed2.aspx

Official Lessons here:
https://msdn.microsoft.com/en-us/library/bb383971(v=vs.90).aspx
https://msdn.microsoft.com/it-it/library/jj153219.aspx