Environment Setup for ASP.NET Core Web API Development
In this article, I am going to discuss the Environment Setup required for developing ASP.NET Core Web API Applications. Please read our previous article where we discussed HTTP Protocols. Tools and Software Requires for the development of ASP.NET Core Web API Applications.
- Operating System: (Windows, Mac, Linux)
- Editor: Visual Studio 2019 (latest version), Visual Studio Code.
- Dot Net Core SDK 5 (Latest Version as of this writing): This is the software development KIT and this KIT is helpful for the development and running of the application in the system.
- Database: SQL Server 2019
- SSMS (SQL Server Management Studio): To interact with SQL Server database
- API Client: Postman, Fiddler. These are client tools and are used to test the Web APIs
You are free to use any operating system as per your choice. .NET Core is an open-source and cross-platform framework. So, you can use any type of Operating System such as Windows, Mac, and Linus for ASP.NET Core Web API Application development. I am going to use Windows Operating System.
Download and install .NET Core SDK 5 (Latest Version)
Once you decide Operating System, next you need to install .NET Core SDK on that machine. In order to download .NET Core SDK, please go to the below Website.
Once you go to the above website, you will find the following webpage. As per your operating system choose the appropriate .NET Core SDK. The latest version as of this writing is .NET 5.0 and this is the recommended one as shown in the below image.
Further, in .NET 5, there are three options to download the .NET Core SDK which are as follows:
- .NET Runtime: The .NET Runtime is required only to run .NET Core applications. The .NET Runtime just contains the resources or libraries that are required to run existing .NET Core applications.
- .NET SDK: If you want to develop, build, run, test, and deploy your .NET Core Applications, then you need to download the .NET SDK (Software Development Kit). The .NET SDK also contains.NET Runtime. So, if you installed the .NET SDK, then there is no need to install .NET Runtime separately.
- All .NET downloads: If you want an older version of .NET (like .NET Core 3.1), then you need to click on this link and it will navigate to another page, from where you can download the .NET core Framework version as per your choice.
As we are here to develop, build, run and deploy .NET Core Applications, so we need to click on the Download .NET SDK x64 link. Once you click on the Download .NET SDK x64 button it will download the .NET Core SDK.
Once you download the .NET SDK, then install it by following the required steps. If everything fine, once the installation completed, you will get the following.
Note: If you installed .NET Core SDK on your machine, then there is no need to install .NET Runtime separately as .NET Core SDK automatically the .NET Runtime. The .NET Runtime is a part of .NET SDK. Another point that you need to keep in mind is that, once you installed .NET Core SDK, then automatically ASP.NET Core gets installed.
Verifying the Installation:
Once you’ve installed .NET SDK, open the command prompt and type dotnet and press the enter key as shown in the below image. If the installation succeeded, then you should get the following output.
Now in order to verify what versions installed on your machine, type the dotnet –info command in the command prompt and press enter as shown in the below image.
As you can see in the above image, in my machine, .NET SDK version 5.0.201 is installed. Along the way, it also displays the OS Name, Version, etc. Further, if you notice it also installed .NET Runtimes.
Note: The .NET Core SDK will give a complete environment to develop, build, test and deploy the ASP.NET Core Web API Applications.
Integrated Development Environment (IDE) for ASP.NET Core Web API Development:
You can use any of the following IDEs to develop the ASP.NET Core Web API Applications.
- Visual Studio 2019
- Visual Studio Code
- .Net Core CLI
We will discuss using all the above options to develop the ASP.NET Core Web API Applications. But from the beginning, we are going to use Visual Studio 2019 as the IDE for ASP.NET Core Web API development.
Download Visual Studio 2019:
If you have not installed Visual Studio 2019, then please download and installed Visual From the below URL.
Once you navigate to the above URL, and if you are a student and you just want to learn ASP.NET Core Web API, then I recommended you to choose the Community edition of Visual Studio 2019 which is free as shown in the below image and the community version has all the features of the enterprise edition has.
While installing Visual Studio 2019, please make sure ASP.NET and Web development workload is installed. To verify this, whether you have installed this workload or not, Open Visual Studio Installer and then click on the Modify button as shown in the below image.
Once you click on the Modify button, the following screen window will open. Here select the Workloads option and then make sure the ASP.NET and Web Development checkbox to be checked as shown in the below image.
How to Download and Install Visual Studio Code
Let us see how to download and install Visual Studio Code. In order to download Visual Studio Code, please click on the following link.
Once you click on the above link, it will open the below website, from this webpage just click on the Download button which you can see at the top of the website as shown below.
Once you click on the Download button, it will open the following page. Based on your operating system choose the appropriate visual studio. I have windows 10 installed on my machine, so I installed the Windows option as shown in the below image.
Once the download completed, click on the setup file follow the on-screen steps to install Visual Studio on your machine.
Note: Visual Studio and Visual Studio Code are editors. They will help us to write the code quickly. But you are free to use any editor as per your choice such as Notepad ++, Atom, Sublime, etc.
Install SQL Server 2019:
Next, we are going to install SQL Server 2019. Remember we are going to develop Web APIs and to work with Wen APIs, we need some data. You can hard code the data in memory. But in Real-time, we need to work with a database. As a database, in this tutorial, we are going to use SQL Server. If you have not installed SQL server 2019 on your machine, then please download and installed it from the below URL.
Once you click on the above link, it will open the below page. Here we have many options to use SQL Server database. Here, click on the Download now button which is below the Developer tab as shown in the below image.
SQL Server 2019 Developer is a full-featured free edition, licensed for use as a development and test database in a non-production environment. Once you download, then install it by following the on-screen steps.
SQL Server is a DBMS and provides the complete environment to save and work with the data of an application. SQL Server stores the data in form of Tables. We can create relationships between the tables. You can use SQL Server from any other server from your local machine.
Install SQL Server Management Studio:
Once you have installed the SQL Server database, then you need an interface to interact with the SQL Server Database. And for that, we are going to use SQL Server Management Studio (SSMS) to interact with the SQL Server database. If you have not installed SSMS on your machine, then please download and installed the SQL Server Management Studio from the below link.
Once you go to the above link, it will open the below webpage and simply click on the Download SQL Server Management Studio (SSMS) link as shown in the below image.
Once you download SSMS, then install it. SQL Server Management Studio (SSMS) is an integrated environment for managing any SQL infrastructure, from SQL Server to Azure SQL Database. SSMS provides tools to configure, monitor, and administer instances of SQL Server and databases. Use SSMS to deploy, monitor, and upgrade the data-tier components used by your applications, and build queries and scripts.
Use SSMS to query, design, and manage your databases and data warehouses, wherever they are – on your local computer, or in the cloud.
As we are going to work with the Web API, we also need one Web API client tool. And for the client tool, we are going to use Postman. In order to install Postman, click on the below link.
Once you click on the above link, it will open the below webpage. From the below page, click on the Download the App link to download postman on your machine. Depending upon your operating system, you can choose either 32-bit or 64-bit. I have installed a 64-bit operating system and so, I choose Windows 64 bit as shown in the below image.
Once you download, then install it. A postman is an API tool. Postman provides a complete and nice interface to work with APIs.
That’s it. We are ready with our environment to develop ASP.NET Core Web API Applications. In the next article, I am going to discuss How to Create, Build, Run, and Test ASP.NET Core Web API Application using .NET Core CLI. Here, in this article, I explain the Environment Setup for ASP.NET Core Web API Application Development and I hope you enjoy this ASP.NET Core Web API Environment setup for Development article.