mac安装.net core

本文详细介绍如何在MacOS 10.11或更高版本上安装.NET Core SDK。首先,你需要通过Homebrew安装OpenSSL。然后下载并使用官方安装程序安装.NET Core SDK,这将把最新稳定版的工具添加到你的PATH中。最后,通过初始化一个简单的HelloWorld应用并运行它来验证安装是否成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://www.microsoft.com/net/core#macos

Install for macOS 10.11 or higher (64 bit)

  1. 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:

    1. brew update
    2. brew install openssl
    3. mkdir -p /usr/local/lib
    4. ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
    5. 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. 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 SDK

    This 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. 3

    Initialize some code

    Let's initialize a sample Hello World application!

    1. dotnet new console -o hwapp
    2. cd hwapp
  4. 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:

    1. dotnet restore
    2. dotnet run
  5.  

    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.

  6.  

    Want some tools?

    Get an editor to help you be more productive with .NET Core.

转载于:https://www.cnblogs.com/xqnq2007/p/7258676.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值