mac安装.net core
https://www.microsoft.com/net/core#macos
Install for macOS 10.11 or higher (64 bit)
-
1
Install pre-requisites
In order to use .NET Core, you first need to install the latest version of OpenSSL. The easiest way to get this is from Homebrew.
After installing
brew
, do the following:- 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/
Video: Installing .NET Core and Visual Studio Code in a Mac
-
2
Install .NET Core SDK
The best way to install .NET Core 1.1 on macOS is to download the official installer.
Download .NET Core SDKThis installer will install the latest stable version of the tools and put them on your PATH so you can run
dotnet
from the Console..NET Core 1.1 is the latest version. For long term support versions and additional downloads check the all downloads section.
Note: if you have any problems with installation on macOS, please consult our known issues page.
-
3
Initialize some code
Let's initialize a sample Hello World application!
- dotnet new console -o hwapp
- cd hwapp
-
4
Run the app
The first command will restore the packages specified in the project file, and the second command will run the actual sample:
- dotnet restore
- dotnet run
-
And you're ready!
You now have .NET core running on your machine!
Visit the .NET Documentation to get access to additional tutorials, samples and the full .NET Core documentation.
-
Want some tools?
Get an editor to help you be more productive with .NET Core.