| title | Prerequisites for .NET Core on Mac | |
|---|---|---|
| description | Supported macOS versions and .NET Core dependencies to develop, deploy, and run .NET Core applications on macOS machines. | |
| keywords | .NET, .NET Core, macOS, Mac | |
| author | guardrex | |
| ms.author | mairaw | |
| ms.date | 09/27/2017 | |
| ms.topic | article | |
| ms.prod | .net-core | |
| ms.devlang | dotnet | |
| ms.assetid | c33b1241-ab66-4583-9eba-52cf51146f5a | |
| ms.workload |
|
This article shows you the supported macOS versions and .NET Core dependencies that you need to develop, deploy, and run .NET Core applications on macOS machines. The supported OS versions and dependencies that follow apply to the three ways of developing .NET Core apps on a Mac: via the command-line with your favorite editor, Visual Studio Code, and Visual Studio for Mac.
.NET Core 2.x is supported on the following versions of macOS:
- macOS 10.12 "Sierra" and later versions
See .NET Core 2.x Supported OS Versions for the complete list of .NET Core 2.x supported operating systems, out of support OS versions, and lifecycle policy links.
.NET Core 1.x is supported on the following versions of macOS:
- macOS 10.12 "Sierra"
- macOS 10.11 "El Capitan"
See .NET Core 1.x Supported OS Versions for the complete list of .NET Core 1.x supported operating systems, out of support OS versions, and lifecycle policy links.
Download and install the .NET Core SDK from .NET Downloads. If you have problems with the installation on macOS, consult the Known issues topic for the version you have installed.
.NET Core 1.x
.NET Core 1.x requires OpenSSL when running on macOS. An easy way to obtain OpenSSL is by using the Homebrew ("brew") package manager for macOS. After installing brew, install OpenSSL by executing the following commands at a Terminal (command) prompt:
brew update
brew install openssl
mkdir -p /usr/local/lib
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/Download and install the .NET Core SDK from .NET Downloads. If you have problems with the installation on macOS, consult the 1.0.0 Known Issues and 1.0.1 Known Issues topics.
The default open file limit on macOS may not be sufficient for some .NET Core workloads, such as restoring projects or running unit tests.
You can increase this limit by following these steps:
- Using a text editor, create a new file /Library/LaunchDaemons/limit.maxfiles.plist, and save the file with this content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>limit.maxfiles</string>
<key>ProgramArguments</key>
<array>
<string>launchctl</string>
<string>limit</string>
<string>maxfiles</string>
<string>2048</string>
<string>4096</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceIPC</key>
<false/>
</dict>
</plist>- In a terminal window, run the following command:
echo 'ulimit -n 2048' | sudo tee -a /etc/profile- Reboot your Mac to apply these settings.
You can use any editor to develop .NET Core applications using the .NET Core SDK. However, if you want to develop .NET Core applications on a Mac in an integrated development environment, you can use Visual Studio for Mac.
.NET Core development on macOS with Visual Studio for Mac requires:
- A supported version of the macOS operating system
- OpenSSL (.NET Core 1.x only; .NET Core 2.x uses security services available natively in macOS)
- .NET Core SDK for Mac
- Visual Studio for Mac