In 2016 we’ve seen some exciting new tech things arrive: VR head-mounted displays from Oculus, HTC, Sony with VR games we dreamed about in the 1990s; PS4 Pro; nVidia 16nm Pascal chip. What I’m most excited about, though, is finally here after a decade of waiting: Microsoft .NET Core cross-platform support. Now I can write, build, and run .NET software on macOS, Linux, or Windows. Use the console, editor of choice, or Microsoft VS Code to write C# code, test, debug, and target multiple platforms. It’s about time! (Sure, Mono is nice, but this is cool!)
To get started with .NET Core, check out the guide at docs.microsoft.com/en-us/dotnet/articles/core/index and try out some tutorials. Find the SDK at https://www.microsoft.com/net/core.
How to setup .NET Core SDK on Mac
Follow the .NET Core installation instructions, which are a bit out of date as of this writing, so I’ll summarize the steps and note the difference here.
1. Use Homebrew to get OpenSSL
Enter the commands in console as shown.
2. Use the installer
3. and 4. Follow the instructions to test everything is working.
Creating a new application using “dotnet new” may be run immedately and should output “Hello, World!”
If not working
Try the following (edit for your version of .NETCore):
5. Install Visual Studio Code
You may write and debug .NET Core applications on Linux or macOS using VS Code. Download at code.visualstudio.com. Once up and running, install the C# extension by selecting View->Extensions and typing in “C# for Visual Studio Code” and click the install button after “C# for Visual Studio Code (powered by OmniSharp).”
VS Code 1.5 introduces icon themes and includes Seti UI making file type quicker to identify.
Setup .NET Core SDK on Linux Mint 18
Add extensions using Ctrl+Shift+X (Cmd+Shift+X) and start typing:
- c# for visiual studio code
- c# xml documentation
Resources and tutorials to get started
- dotnet core on GitHub
- “.NET Core Guides” where you’ll find links to the following and more.
- “Getting started with .NET Core on Windows/Linux/macOS using the command line”
- “Getting started with .NET Core on macOS, using Visual Studio Code”
- “.NET Core App Types” explains portable vs self-contained apps.
- “.NET Core Runtime IDentifier (RID) catalog” shows list of RIDs and how to use.
- “Samples and Tutorials”
- “Console Application” Teleprompter tutorial is a nice one and includes Task, file reading, Enumerator method.
Visual Studio Code, Windows, and .NET Core are trademarks of Microsoft. macOS is a trademark of Apple. Linux® is a registered trademark of Linus Torvalds.