In this post we'll set up all the tools required to start developing an ASP.NET MVC Project. Base libraries such as .Net Framework and ASP.NET MVC 4 Framework are free, others can be found in a free version or in a more powerful commercial version. What it is sure is that you have to own a Microsoft Windows Operating System.
To start your ASP.NET development you must run a Microsoft Windows operating system. This is the list of operating system and hardware requirements taken from Microsoft website:
Supported operating systems
For this tutorial we have tried all the code on Windows 7 Home Premium.
The main tool you need in order to start your development is Microsoft Visual Studio. This tool must be purchased, but there is an "Express" edition of it that is free. If you download it from this page, you can select a package that installs the required software development tools and all the required frameworks.
If you already own a Visual Studio copy, on the same page you can find out instructions to install additional required components and, in particular, the ASP.Net MVC 4 framework.
To know the differences between the standard and the Express edition of Visual Studio you can look at this Wikipedia page.
The full package will install also additional tools such as Microsoft SQL Server Express. We will use it in our example, so if you don't have a working version of SQL Server, you have to install it.
The .Net framework version used in our example is the 4.5.
Visual Studio comes with a set of templates that allow the programmer to easy start different kind of projects.
If you select "New project..." you can find a list of these templates. To start an ASP.Net MVC 4 application select the corresponding template under the C# section.
The additional information you have to specify are related to the application name that is, for this tutorial, MyTasks. Leave all other options at their default value and click the OK button.
After selecting the application type, the required references are automatically set, but Visual Studio offers the possibility to start, not only with an empty application, but also with some code related to the authentication already set up.
In the next windows we can select the "Internet application" template that adds user authentication code based on a standard HTML authentication form. This code is common in every internet application, it is well written an can be customized to get authentication information from different sources.
In one of the following posts we'll customise this code, so this selection we'll be the right one.
The visualization engine we will use is Razor. The approach taken by this engine allows to create HTML pages that are very similar to the PHP or VbScript.ASP pages we are used to write. In particular Razor is structured to allow the mix of HTML and C# code in a very easy way.
We don't need a Unit test project, so we can click on the OK button and let Visual Studio creating our application.
In the next post we will look to the generated code, but, at this moment, we only try to launch the application to see what Visual Studio has already created for us.
In the Visual Studio window click on the debug icon or press F5. This will compile the application and launch your preferred browser to start the debug.
After some second you will see, in your browser window, the homepage of the application with a default page that gives you a lot of information on what to do next.
In this page you will find the following elements:
By clicking on the authorization related links you will find a fully working section that allows you to register to the system, login and logout. User data are stored in a mdf database positioned in the App_Data folder.
Stay tuned for the next chapter with the explanation of the generated code!