Mac os x net install with windows

Установка .NET в macOS Install .NET on macOS

В этой статье вы узнаете, как установить .NET в macOS. In this article, you’ll learn how to install .NET on macOS. .NET состоит из среды выполнения и пакета SDK. .NET is made up of the runtime and the SDK. Среда выполнения используется для запуска приложения .NET и может не включаться в состав приложения. The runtime is used to run a .NET app and may or may not be included with the app. Пакет SDK используется для создания приложений и библиотек .NET. The SDK is used to create .NET apps and libraries. Среда выполнения .NET всегда устанавливается вместе с пакетом SDK. The .NET runtime is always installed with the SDK.

.NET 5.0 является последней версией. The latest version of .NET is 5.0.

Поддерживаемые выпуски Supported releases

В приведенной ниже таблице содержится список поддерживаемых сейчас выпусков .NET и версий macOS, в которых они поддерживаются. The following table is a list of currently supported .NET releases and the versions of macOS they’re supported on. Эти версии будут поддерживаться до окончания срока поддержки .NET. These versions remain supported either the version of .NET reaches end-of-support.

  • Значок ✔️ означает, что версия .NET Core поддерживается. A ✔️ indicates that the version of .NET Core is still supported.
  • Значок ❌️ означает, что версия .NET Core не поддерживается. A ❌ indicates that the version of .NET Core isn’t supported.
Операционная система Operating System .NET Core 2.1 .NET Core 2.1 .NET Core 3.1 .NET Core 3.1 .NET 5.0 .NET 5.0
macOS 11.0 «Big Sur» macOS 11.0 «Big Sur» ✔️ 2.1 (заметки о выпуске) ✔️ 2.1 (Release notes) ✔️ 3.1 (заметки о выпуске) ✔️ 3.1 (Release notes) ✔️ 5.0 (заметки о выпуске) ✔️ 5.0 (Release notes)
macOS 10.15 «Catalina» macOS 10.15 «Catalina» ✔️ 2.1 (заметки о выпуске) ✔️ 2.1 (Release notes) ✔️ 3.1 (заметки о выпуске) ✔️ 3.1 (Release notes) ✔️ 5.0 (заметки о выпуске) ✔️ 5.0 (Release notes)
macOS 10.14 «Mojave» macOS 10.14 «Mojave» ✔️ 2.1 (заметки о выпуске) ✔️ 2.1 (Release notes) ✔️ 3.1 (заметки о выпуске) ✔️ 3.1 (Release notes) ✔️ 5.0 (заметки о выпуске) ✔️ 5.0 (Release notes)
macOS 10.13 «High Sierra» macOS 10.13 «High Sierra» ✔️ 2.1 (заметки о выпуске) ✔️ 2.1 (Release notes) ✔️ 3.1 (заметки о выпуске) ✔️ 3.1 (Release notes) ✔️ 5.0 (заметки о выпуске) ✔️ 5.0 (Release notes)
macOS 10.12 «Sierra» macOS 10.12 «Sierra» ✔️ 2.1 (заметки о выпуске) ✔️ 2.1 (Release notes) ❌ 3.1 (заметки о выпуске) ❌ 3.1 (Release notes) ❌ 5.0 (заметки о выпуске) ❌ 5.0 (Release notes)

Неподдерживаемые выпуски Unsupported releases

Следующие версии .NET больше не поддерживаются (❌). The following versions of .NET are ❌ no longer supported. (но остаются доступными для скачивания): The downloads for these still remain published:

Сведения о среде выполнения Runtime information

Среда выполнения используется для запуска приложений, созданных с помощью .NET. The runtime is used to run apps created with .NET. При публикации приложения автор может включить среду выполнения в его состав. When an app author publishes an app, they can include the runtime with their app. В противном случае устанавливать среду выполнения будет пользователь. If they don’t include the runtime, it’s up to the user to install the runtime.

В macOS можно установить две разные среды выполнения: There are two different runtimes you can install on macOS:

Среда выполнения ASP.NET Core ASP.NET Core runtime
Используется для запуска приложений ASP.NET Core. Runs ASP.NET Core apps. Включает среду выполнения .NET. Includes the .NET runtime.

Среда выполнения .NET .NET runtime
Простейшая среда выполнения, в состав которой не входят какие-либо другие среды выполнения. This runtime is the simplest runtime and doesn’t include any other runtime. Чтобы обеспечить максимальный уровень совместимости с приложениями .NET, настоятельно рекомендуется устанавливать среду выполнения ASP.NET Core. It’s highly recommended that you install ASP.NET Core runtime for the best compatibility with .NET apps.

Сведения о пакете SDK SDK information

Пакет SDK используется для создания и публикации приложений и библиотек .NET. The SDK is used to build and publish .NET apps and libraries. При установке пакета SDK также устанавливаются обе среды выполнения: ASP.NET Core и .NET. Installing the SDK includes both runtimes: ASP.NET Core and .NET.

Зависимости Dependencies

Платформа .NET поддерживается в следующих выпусках macOS: .NET is supported on the following macOS releases:

Символ + представляет минимальную версию. A + symbol represents the minimum version.

Версия .NET Core .NET Core Version macOS macOS Архитектуры Architectures Дополнительные сведения More information
5,0 5.0 High Sierra (10.13+) High Sierra (10.13+) X64 x64 Дополнительные сведения More information
3.1 3.1 High Sierra (10.13+) High Sierra (10.13+) X64 x64 Дополнительные сведения More information
3.0 3.0 High Sierra (10.13+) High Sierra (10.13+) X64 x64 Дополнительные сведения More information
2.2 2.2 Sierra (10.12+) Sierra (10.12+) X64 x64 Дополнительные сведения More information
2.1 2.1 Sierra (10.12+) Sierra (10.12+) X64 x64 Дополнительные сведения More information

Начиная с macOS Catalina (версия 10.15) все программное обеспечение, созданное после 1 июня 2019 года и распространяемое с идентификатором разработчика, должно быть заверено. Beginning with macOS Catalina (version 10.15), all software built after June 1, 2019 that is distributed with Developer ID, must be notarized. Это требование относится к среде выполнения .NET, пакету SDK для .NET и программному обеспечению, созданному с помощью .NET. This requirement applies to the .NET runtime, .NET SDK, and software created with .NET.

Среда выполнения и установщики пакета SDK для .NET версии 5.0 и .NET Core 3.1, 3.0 и 2.1 были заверены с 18 февраля 2020 г. The runtime and SDK installers for .NET 5.0 and .NET Core 3.1, 3.0, and 2.1, have been notarized since February 18, 2020. Более ранние версии не заверены. Prior released versions aren’t notarized. При запуске незаверенного приложения появится ошибка, аналогичная следующей: If you run a non-notarized app, you’ll see an error similar to the following image:

Дополнительные сведения о том, как принудительное заверение влияет на .NET (и ваши приложения .NET), см. в разделе Работа с заверением macOS Catalina. For more information about how enforced-notarization affects .NET (and your .NET apps), see Working with macOS Catalina Notarization.

libgdiplus libgdiplus

Приложения .NET, которые используют сборку System.Drawing.Common, требуют установки libgdiplus. .NET applications that use the System.Drawing.Common assembly require libgdiplus to be installed.

Легко получить libgdiplus можно с помощью диспетчера пакетов Homebrew («brew») для macOS. An easy way to obtain libgdiplus is by using the Homebrew («brew») package manager for macOS. После установки brew установите libgdiplus, выполнив следующие команды в окне терминала (аналог командной строки): After installing brew, install libgdiplus by executing the following commands at a Terminal (command) prompt:

Установка с помощью установщика Install with an installer

В macOS есть автономные установщики, которые можно использовать для установки пакета SDK для .NET 5.0: macOS has standalone installers that can be used to install the .NET 5.0 SDK:

Скачивание и установка вручную Download and manually install

В качестве альтернативы установщикам macOS для .NET можно скачать и вручную установить пакет SDK и среду выполнения. As an alternative to the macOS installers for .NET, you can download and manually install the SDK and runtime. Ручная установка как правило выполняется в рамках тестирования непрерывной интеграции. Manual install is usually performed as part of continuous integration testing. В большинстве случаев разработчикам и пользователям рекомендуется использовать установщик. For a developer or user, it’s generally better to use an installer.

При установке пакета SDK для .NET не нужно устанавливать соответствующую среду выполнения. If you install .NET SDK, you don’t need to install the corresponding runtime. Сначала скачайте двоичный выпуск пакета SDK или среды выполнения с одного из следующих сайтов: First, download a binary release for either the SDK or the runtime from one of the following sites:

Извлеките скачанный файл и используйте команду export , чтобы задать переменные, используемые .NET, а затем проверьте включение .NET в переменную PATH. Next, extract the downloaded file and use the export command to set variables used by .NET and then ensure .NET is in PATH.

Чтобы извлечь среду выполнения и сделать команды .NET CLI доступными в терминале, сначала скачайте двоичный выпуск .NET. To extract the runtime and make the .NET CLI commands available at the terminal, first download a .NET binary release. Затем откройте терминал и выполните следующие команды в каталоге с сохраненным файлом. Then, open a terminal and run the following commands from the directory where the file was saved. Имя файла архива может отличаться в зависимости от скачанных файлов. The archive file name may be different depending on what you downloaded.

Используйте следующие команды для извлечения скачанной среды выполнения или пакета SDK. Use the following commands to extract the runtime or SDK that you downloaded. Не забудьте заменить значение DOTNET_FILE на имя файла: Remember to change the DOTNET_FILE value to your file name:

Приведенные выше команды export сделают команды .NET CLI доступными только для сеанса терминала, в котором производился запуск. The preceding export commands only make the .NET CLI commands available for the terminal session in which it was run.

Вы можете изменить профиль оболочки, чтобы добавить команды окончательно. You can edit your shell profile to permanently add the commands. Существует несколько различных оболочек, доступных для Linux, и каждая из них имеет свой профиль. There are a number of different shells available for Linux and each has a different profile. Пример: For example:

    Оболочка Bash:

/.bashrc Bash Shell:

/.bashrc
Оболочка Korn:

/.kshrc или .profile Korn Shell:

/.kshrc or .profile
Оболочка Z:

/.zshrc или .zprofile Z Shell:

Измените соответствующий исходный файл оболочки и добавьте :$HOME/dotnet в конец существующего оператора PATH . Edit the appropriate source file for your shell and add :$HOME/dotnet to the end of the existing PATH statement. Если оператор PATH не указан, добавьте новую строку с export PATH=$PATH:$HOME/dotnet . If no PATH statement is included, add a new line with export PATH=$PATH:$HOME/dotnet .

Кроме того, добавьте export DOTNET_ROOT=$HOME/dotnet в конец файла. Also, add export DOTNET_ROOT=$HOME/dotnet to the end of the file.

Такой подход позволяет устанавливать разные версии в отдельные расположения и выбирать, какие из них следует использовать для каждого приложения. This approach lets you install different versions into separate locations and choose explicitly which one to use by which application.

Установка с помощью Visual Studio для Mac Install with Visual Studio for Mac

Visual Studio для Mac устанавливает пакет SDK для .NET, если выбрана рабочая нагрузка .NET. Visual Studio for Mac installs the .NET SDK when the .NET workload is selected. Чтобы приступить к разработке в .NET на macOS, ознакомьтесь со статьей Установка Visual Studio 2019 для Mac. To get started with .NET development on macOS, see Install Visual Studio 2019 for Mac.

Версия пакета SDK для .NET .NET SDK version Версия Visual Studio Visual Studio version
5,0 5.0 Visual Studio 2019 для Mac версии 8.8 или более поздней. Visual Studio 2019 for Mac version 8.8 or higher.
3.1 3.1 Visual Studio 2019 для Mac версии 8.4 или более поздней. Visual Studio 2019 for Mac version 8.4 or higher.
2.1 2.1 Visual Studio 2019 для Mac версии 8.0 или более поздней. Visual Studio 2019 for Mac version 8.0 or higher.

Установка вместе с Visual Studio Code Install alongside Visual Studio Code

Visual Studio Code — это эффективный и облегченный редактор исходного кода, который работает на компьютере. Visual Studio Code is a powerful and lightweight source code editor that runs on your desktop. Visual Studio Code доступен для Windows, macOS и Linux. Visual Studio Code is available for Windows, macOS, and Linux.

Хотя Visual Studio Code не поставляется с автоматическим установщиком .NET, таким как Visual Studio, добавление поддержки .NET не вызывает затруднений. While Visual Studio Code doesn’t come with an automated .NET installer like Visual Studio does, adding .NET support is simple.

Установка с помощью функции автоматизации Bash Install with bash automation

Сценарии dotnet-install используются для автоматизации установок среды выполнения и их осуществления без прав администратора. The dotnet-install scripts are used for automation and non-admin installs of the runtime. Вы можете скачать сценарий со страницы справочника по сценариям dotnet-install. You can download the script from the dotnet-install script reference page.

Этот сценарий по умолчанию устанавливает последнюю версию с долгосрочной поддержкой (LTS), которой сейчас является .NET Core 3.1. The script defaults to installing the latest long term support (LTS) version, which is .NET Core 3.1. Вы можете выбрать конкретный выпуск, указав параметр current . You can choose a specific release by specifying the current switch. Включите параметр runtime для установки среды выполнения. Include the runtime switch to install a runtime. В противном случае сценарий устанавливает пакет SDK. Otherwise, the script installs the SDK.

Приведенная выше команда устанавливает среду выполнения ASP.NET Core для максимальной совместимости. The previous command installs the ASP.NET Core runtime for maximum compatability. Среда выполнения ASP.NET Core также включает в себя стандартную среду выполнения .NET. The ASP.NET Core runtime also includes the standard .NET runtime.

Docker Docker

Контейнеры обеспечивают простой способ изоляции приложения от остальной части основной системы. Containers provide a lightweight way to isolate your application from the rest of the host system. Контейнеры на одном компьютере совместно использую только ядро, а также используют ресурсы, которые передаются в приложение. Containers on the same machine share just the kernel and use resources given to your application.

.NET можно выполнять в контейнере Docker. .NET can run in a Docker container. Официальные образы Docker для .NET публикуются в реестре контейнеров Microsoft (MCR), и доступ к ним можно получить в репозитории Microsoft .NET Core Docker Hub. Official .NET Docker images are published to the Microsoft Container Registry (MCR) and are discoverable at the Microsoft .NET Core Docker Hub repository. Каждый репозиторий содержит рабочие образы для разных сочетаний .NET (пакета SDK или среды выполнения) и операционной системы. Each repository contains images for different combinations of the .NET (SDK or Runtime) and OS that you can use.

Корпорация Майкрософт предоставляет образы, которые предназначены для конкретных сценариев. Microsoft provides images that are tailored for specific scenarios. Например репозиторий ASP.NET Core содержит образы, которые предназначены для запуска приложений ASP.NET Core в рабочей среде. For example, the ASP.NET Core repository provides images that are built for running ASP.NET Core apps in production.

Дополнительные сведения об использовании .NET Core в контейнере Docker см. в статьях Введение в .NET и Docker и Примеры. For more information about using .NET Core in a Docker container, see Introduction to .NET and Docker and Samples.

Читайте также:  После обновления windows пропал bluetooth
Оцените статью