Saturday, July 27, 2019

Launch Settings in ASP.NET Core WebAPI

Asp.Net core applications contain a new settings file called launchSettings.json, this file is under the Properties menu. The file contains the settings for running the application in different environments.

By default an Asp.Net Core Web API project contains 2 settings. First one for running under IIS Express and the 2nd settings for running in command line.

Creating a HelloWorld WebAPI Project in Asp.Net Core

Open Visual Studio 2017
Create a new Project of type Asp.Net Core Web Application



Select the API template

What is Asp.Net Core WebAPI?

When Microsoft released Asp.Net Core MVC it also released the API version which is Asp.Net Core Web API. Asp.Net Core Web API is used to create restful services which can be used to create HTTP services which don’t have a View layer but have Controllers and Models, they process incoming requests and responds with data in JSON format.

Since Asp.Net Core Web API does not have a view layer, it also does not have the Razor view engine it returns the data in JSON format to other UI layer applications like Angular / Reach which will handle the UI rendering.