Tech

How to Install .Net Core & Visual Studio .net for mac OS in 4 steps

Looking to setup .NET for Mac and to use .NET Core cross plateform feature? The “trick” is not waste time in installing...

· 3 min read >

Looking to setup .NET for Mac and to use .NET Core cross plateform feature? The “trick” is not waste time in installing it manually.

With this approach you can get your .NET Core development enviorment up and running in less than 10 minutes and in 4 steps. Moreover , This method has been battle tested at top 3 consulting firms to get people on boarded in minimal time.

Finally, As a bonus you will also create a hello world application to verify that your setup is working as expected . Yes all in less than 10 minutes and with no hassle. You can also read about when to choose .net core

4 Key points to Consider for setup on .NET for MAC

Above all , if you are just getting started or you have a extensive .NET background if your goal is to not waste time and get going fast don’t skip this section.

Let’s go through these points very carefully

  • As of writing this guide the Visual Studio for Mac – Latest version is 2019
  • .NET Core is automatically installed when you install visual studio. what that mean for you is if you install visual studio the default Latest SDK is automatically installed. This trick will save you from lot of troubles.
  • C# 8.0 is default for .NET Core 3.x version onward.
  • If you only install .NET Core run-time you won’t be able to develop application you must have SDK(Software development kit) to develop .NET Core applications.

The Layout for our journey.

installing visual studio on mac  steps
steps for .net core install macOS & installing visual studio on mac

Summary of the steps for installing visual studio on Mac Os & .Net core Sdk

Time Needed : 10 minutes

How to Install Visual Studio .NET for Mac OS

  1. Download visual studio for mac

    Download the Visual Studio for Mac from Microsoft website by following this link. https://visualstudio.microsoft.com/vs/mac/
    download visual studio code

  2. Install visual studio for mac

    Locate the installer (Usually Downloads folder) that is downloaded in previous step and click on it to run it and click on install visual studio for Mac.

  3. Verify/Check the .NET Core Version using terminal

    Open the terminal on MAC – (Inside application -> Utilities folder) and type the command below
    dotnet –info

  4. Use Visual Studio to create a hello world console app

    Click on New and Select Console Application -> Click Next
    Give your console app some name and click create
    click on top left play button to run the project and verify the output
    dotnet run

Materials
  • Mac with macOS High Sierra 10.13 or above in our case we used Latest macOS Catlina (version 10.15 .7)

Detailed Guide Start From Here…

installing visual studio on mac OS Catalina
&
.NET CORE

Visual Studio for Mac Tutorial

First Download by following this link.    https://visualstudio.microsoft.com/vs/mac/

installing visual studio on mac

Now , Click on allow the permission to download it.

installing visual studio on mac

After that ,Locate the installer (Usually Downloads folder) that is downloaded in previous step and click on it to run it and click on install visual studio for Mac as highlighted below.

installing visual studio on mac

It might ask for permission to run the executable – click on Open

installing visual studio on mac

In addition , Make sure .NET Core is selected as target and then click on install bottom right, there are also other options available as target but that is out of scope of current discussion.

.NET for Mac OS

After that ,Wait for install/Download to complete – the time varies based on the internet and machine speed.

.NET for Mac OS

Now finally , at end of installation a popup comes up about install CLI Tools you can skip that and click on Done. You can always do this later.

how to install visual studio in mac os

Skip the sign-in for now. if you have an account you can optionally login if you want.

Now let’s make the Keyboard Layout choice – I selected MAC layout and Clicked Continue

In short, the installation is complete, now we have to verify.

Check the .NET Core Version on MacOs using terminalOpen the terminal on MAC – (Inside application -> Utilities folder) and type the command below

dotnet –info

Prints out detailed information about a .NET Core installation and the machine environment, such as the current operating system, and commit SHA of the .NET Core version.

BONUS

visual studio for mac tutorial

Using Visual Studio to create a .NET Core hello world console app

Click on New and Select Console Application -> Click Next

Give your console app some name and click create

It is going to create a project for you. wait until it restores the packages and click on top left play button to run the project

Inspect the output hello world

That’s it for now. Your machine is ready and verified for development.

NET Core is an open-source, general-purpose development platform. You can create .NET Core apps for Windows, macOS, and Linux for x64, x86, ARM32, and ARM64 processors using multiple programming languages. Frameworks and APIs are provided for cloud, IoT, client UI, and machine learning.

ASP.NET Core is a better choice, if you

  • Want to target your Web app on Windows, Linux, and Mac operating systems.
  • Are not afraid of learning new things
  • Are not afraid of breaking and fixing things since ASP.NET Core is not fully matured yet.

Final Thoughts

As much as we love the improvements with .NET Core/.NET Standard Yes, the branding is terrible and has been for some time. Developers who may have worked with Xamarin Studio in the past will recognize Visual Studio for Mac as being Xamarin Studio rebranded. VS for Mac has several editions, including a free community edition

These are all fundamental skills for developing with .NET Core. Here are a few tips to keep in mind:

  • The dotnet new command makes it easy to get a template for starting a new project. It’s also nice if you need a quick reference.
  • Whenever you make changes to the dependencies, you can run the dotnet restore command to get the packages immediately.

Important links below

What is NEXT: Listed below are upcoming post we will cover more scenario

  1. Using visual studio code – require more steps as .NET SDK is manually installed
  2. Using Jet Brain Rider IDE – the best paid option in market but worth it and wins the list due to consistency across all the Operating System.

net core six article

ASP.NET CORE 6 JWT Authentication

Apollo11 in Tech
  ·   9 min read
  • >