Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save projectoperations/d0434bfff8519abbc6a77e2e9cc5302b to your computer and use it in GitHub Desktop.
Save projectoperations/d0434bfff8519abbc6a77e2e9cc5302b to your computer and use it in GitHub Desktop.
Steps of how to create asp net core web api project

Creating a new ASP NET Core Web API

Pre-requiside

  • Ensure that you have installed .NET Core in your machine.

Creating the project

  • Open a terminal window (e.g. Gitbash, linux terminal, mac terminal, etc) then change directory to your projects folder. Inside the folder, run dotnet new webapi -o <name of project's folder> -n <project name> command. Example: dotnet new webapi -o PCShop.Api-n PCShop.Api. Confirm that the new project is created.

  • Change current directory to the new project's directory, and then run dotnet run command to run the Web API. Browse to https://localhost:5001/api/values. Confirm that the page displays an array with "value1" and "value2" elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment