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.
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
- Download visual studio for mac
Download the Visual Studio for Mac from Microsoft website by following this link. https://visualstudio.microsoft.com/vs/mac/
- 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.
- Verify/Check the .NET Core Version using terminal
Open the terminal on MAC – (Inside application -> Utilities folder) and type the command below
dotnet –info - 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
Tools
- visual studio for mac https://visualstudio.microsoft.com/vs/mac/
Materials
- Mac with macOS High Sierra 10.13 or above in our case we used Latest macOS Catlina (version 10.15 .7)
Visual Studio for Mac Tutorial
First Download by following this link. https://visualstudio.microsoft.com/vs/mac/
Now , Click on allow the permission to download it.
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.
It might ask for permission to run the executable – click on Open
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.
After that ,Wait for install/Download to complete – the time varies based on the internet and machine speed.
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.
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 terminal – Open the terminal on MAC – (Inside application -> Utilities folder) and type the command below
dotnet –info
BONUS
visual studio for mac tutorial
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
- The central .NET site—https://dot.net
What is NEXT: Listed below are upcoming post we will cover more scenario
- Using visual studio code – require more steps as .NET SDK is manually installed
- 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.
[…] If using Mac here is the easier way how to install .net core on mac […]
[…] If using Mac here is the easier way how to install .net core on mac […]