Monday, February 4, 2019

Setting up machine for asp.net core and creating first asp.net core web application

Before you begin:

Software

  • An Editor
    • You can choose different editors for asp.net core development like Visual Studio(VS), VS Code, Sublime etc.
  • Also the .NET Core SDK (Software Development Kit) is required to develop asp.net core application
  • I prefer and recommend VS as editor for asp.net core development for Windows OS & to download VS, visit the below link:
  • Visual Studio Community Edition is free to download and Install


  • During installation of VS 2017 – Select .NET Core Cross-Platform Development Workload
  • After the .NET Core cross-platform development tool-set is installed, Visual Studio usually installs a previous version of the .NET Core SDK. The current version of the .NET Core SDK as of this article is 2.2
To update Visual Studio to use .NET Core 2.2 SDK




  • Download and Install .NET Core SDK
  • To check installed version of .NET Core SDK
    • Go and Create a new asp.net core web application, and see the below dialog box


Create new .NET Core 2.2 project


Step 1 : Open visual studio, and then create new project







Step 2 : On the left side bar, select "Web" or ".NET Core" under Visual C#. There you will see the different project templates for .NET Core
  • Select "ASP.NET Core Web Application" template to create .NET Core Web Application
  • Provide the meaningful name of the project
  • Browse the project location
  • Click "OK"








Step 3 : After selecting the "ASP.NET Core Web Application" from step 2, it will display all the available templates for creating ASP.NET Core Web Application templates

  • "Web Application(Model-View-Controller)" automatically generates sample Models, Views, Controller and many other resources needed for building web application. It is also used to create RESTful HTTP Services

  • "API" templates includes the resources that are needed to build the RESTful HTTP Services. It does not contains the User Interface and other Web Specific things like Javascript, CSS, Views, etc.

  • "Web Application" project template is used for creating ASP.NET Core Application with example ASP.NET Core Razor Pages Content

  • "Razor Class Library" is used to create reusable Razor class library project, and can be used in multiple applications
  • "Empty template" is very cleanup to develop the application from beginning. It does not contains any content in it. I prefer to choose the Empty Templates to develop web application from beginning.
So now choose Empty template and uncheck "Configure for HTTPS" for now, and then click "OK"


Step 4 : After project created successfully, Run the project



Step 5 : Now you finally did it! You will see the "Hello World" as output on browser



2 comments: