Prerequisites for .NET Core on macOS
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.
Supported macOS versions
.NET Core 2.x is supported on the following versions of macOS:
- macOS 10.12 "Sierra" and later versions
See .NET Core 2.1 Supported OS Versions and .NET Core 2.2 Supported OS Versions for the complete list of .NET Core 2.1 and .NET Core 2.2 supported operating systems, distributions and versions, out of support OS versions, and lifecycle policy links.
.NET Core dependencies
Increase the maximum open file limit (.NET Core versions before .NET Core SDK 2.0.2)
In older .NET Core versions (before .NET Core SDK 2.0.2), 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.
Visual Studio for Mac
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