Setting up .NET Core

1 minute read

This post details setting up your environment for .NET Core development, specifically for REST APIs. First, I’ll go over the different tools needed to follow along in this series.


This is an ongoing series on .NET Core.

  1. Setting up .NET Core
  2. .NET Core REST API in About 30 Minutes
  3. .NET Core Request/Response
  4. Validation in .NET Core REST API
  5. .NET Core Messages, Exception, and Logging

Tools

:bulb: Tip

If you want to skip over the manual installation, you can skip to “Scripts”, containing scripts for installing all the tools on Windows 10 or Mac OS (Disclaimer: While I’d love to include Linux, due to the lack of concise package management and variables based on build for Linux, I will assume those on Linux are used to figuring out how to download tools on their own and not go through the machinations of including it here).


VS Code

The first thing you’ll want to do is download VS Code if you do not have it already. It can be obtained at https://code.visualstudio.com/

.NET Core

Next, download the .NET Core 2.0 SDK at https://www.microsoft.com/net/download/core or use this direct link for Windows x64.

Postman

Using Postman will allow you to quickly perform requests to the API.

Scripts

Windows 10 (Powershell)

This Windows 10 script uses Chocolatey as the install tool to download and install all of the tools mentioned here.

# Install and upgrade Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco upgrade chocolatey

# Install Tools
cinst visualstudiocode -y
cinst dotnetcore-sdk -y
cinst postman -y

Mac OS

This Mac OS script uses Homebrew along with a “tap” known as Homebrew Cask which is used for a lot of apps not found in Homebrew itself.

# Install Homebrew and Homebrew Cask
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap caskroom/cask

# Install Tools
brew cask install visual-studio-code
brew cask install dotnet-sdk
brew cask install postman