Mono linux ��� ����������

Содержание
  1. Установка и настройка mono на Linux Ubuntu
  2. Установка и запуск mono
  3. Совместное использование с веб-сервером
  4. NGINX
  5. Apache
  6. Дополнительные настройки
  7. Добавить веб-приложение
  8. Смена порта сервера
  9. Compiling Mono on Linux
  10. Building Mono
  11. Compiler/Build dependencies
  12. Debian based distributions
  13. Building Mono from a Release Package
  14. Building Mono From a Git Source Code Checkout
  15. One Stop Shop Build Script (Debian)
  16. Как установить Mono в Ubuntu 20.04
  17. Подготовка
  18. Установка Mono в Ubuntu
  19. Начало работы с Mono
  20. Выводы
  21. Download
  22. Mono for macOS is available as a Mac Package (.pkg)
  23. 1 Add the Mono repository to your system
  24. Ubuntu 20.04 (amd64, armhf, arm64, ppc64el)
  25. Ubuntu 18.04 (i386, amd64, armhf, arm64, ppc64el)
  26. Ubuntu 16.04 (i386, amd64, armhf, arm64, ppc64el)
  27. 2 Install Mono
  28. 3 Verify Installation
  29. Notes
  30. 1 Add the Mono repository to your system
  31. Debian 10 (i386, amd64, armhf, arm64, armel, ppc64el)
  32. Debian 9 (i386, amd64, armhf, arm64, armel, ppc64el)
  33. 2 Install Mono
  34. 3 Verify Installation
  35. Notes
  36. 1 Add the Mono repository to your system
  37. Raspbian 10 (armhf)
  38. Raspbian 9 (armhf)
  39. 2 Install Mono
  40. 3 Verify Installation
  41. Notes
  42. 1 Add the Mono repository to your system
  43. CentOS/RHEL 8 (x86_64)
  44. CentOS/RHEL 7 (x86_64)
  45. CentOS/RHEL 6 (x86_64, i686)
  46. 2 Install Mono
  47. 3 Verify Installation
  48. 1 Add the Mono repository to your system
  49. Fedora 29 and later (x86_64)
  50. Fedora 28 (x86_64)
  51. 2 Install Mono
  52. 3 Verify Installation
  53. Mono for Windows is available as a Windows Installer file
  54. Mono is available on Docker Hub
  55. Available tags
  56. Release Notes
  57. MonoDevelop IDE
  58. Older releases

Установка и настройка mono на Linux Ubuntu

Проект mono позволяет реализовать платформу .NET Framework на системах Linux. В данной инструкции мы разберем процесс его установки на Ubuntu.

Установка и запуск mono

Установку выполняем командой:

apt-get install mono-complete mono-xsp4 asp.net-examples

* пакет mono-complete содержит все возможности Mono; mono-xsp4 предоставляет поддержку ASP.NET; asp.net-examples — содержит примеры скриптов ASP и скрипт для автоматической конфигурации веб-приложения.

Разрешаем автозапуск и стартуем сервис:

systemctl enable mono-xsp4

systemctl start mono-xsp4

Если мы используем брандмауэр, добавим правило:

iptables -I INPUT 1 -p tcp -m tcp —dport 8084 -j ACCEPT

* где 8084 — порт, по умолчанию для mono-xsp4.

Сохраняем правила iptables любым способом, например:

* если данная команда вернет ошибку, устанавливаем iptables-persistent командой apt-get install iptables-persistent.

Для проверки работы сервиса открываем браузер и переходим по адресу http:// :8084/samples/ — мы должны увидеть страницу «Welcome to Mono XSP»:

* не обращаем внимания на некрасивый вид страницы и отсутствующее изображение — это происходит по причине того, что демо верстка немного не коррелирует с настройкой веб-приложения.

Совместное использование с веб-сервером

Рассмотрим процесс настройки mono с веб-серверами NGINX и Apache2 путем проксирования запросов.

NGINX

Открываем файл настройки виртуального домена по умолчанию:

Находим опцию location / и приводим ее к виду:

location / <
proxy_pass http://127.0.0.1:8084/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
>

* где proxy_pass перенаправляет все запросы на внутренний сервер mono-xsp4.

Проверяем корректность настроек:

. и перезапускаем nginx:

systemctl restart nginx

Теперь открываем браузер и заходим по адресу http:// /samples/ (без указания порта). Мы должны увидеть веб-приложение, настроенное на mono.

Apache

Включаем модули для проксирования:

a2enmod proxy proxy_http

* где proxy — главный модель для перенаправления запросов; proxy_http — проксирование HTTP.

Настраиваем виртуальный домен с сайтом — в данном примере для сайта по умолчанию:

Добавляем строки внутри VirtualHost:

.
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8084/
ProxyPassReverse / http://127.0.0.1:8084/
.

* где опция ProxyPreserveHost включаем проксирование для виртуального домена; ProxyPass позволяет перенаправить все запросы на данный сервер (в данном примере, на локальный mono-xsp4); ProxyPassReverse задает правило для возврата ответа — при такой настройке ответ будет возвращаться обратно веб-серверу.

Проверяем корректность настроек:

. и перезапускаем веб-сервер:

systemctl restart apache2

Теперь открываем браузер и переходим по адресу без указания порта — http:// /samples/. Мы должны увидеть веб-приложение, настроенное на mono.

Дополнительные настройки

Разберем некоторые настройки, которые могут пригодится при конфигурировании сервера.

Добавить веб-приложение

Открываем файл webapp:

  • web-application — секция с настройками приложения.
  • name — имя приложения.
  • vpath — путь URL, при обращении по которому приложение доступно.
  • path — путь на сервере, где находятся скрипты приложения.

. также можно использовать дополнительные опции:

  • vhost — имя виртуального хоста, если будем его применять.
  • vport — номер сетевого порта, на котором слушает приложение.
  • enabled — принимает значение true или false. Позволяет включить или отключить приложение.

systemctl restart mono-xsp4

Смена порта сервера

Открываем настройки mono-xsp4:

Ищем опцию port= и меняем ее значение на порт, на котором должен работать сервис:

Источник

Compiling Mono on Linux

Pick an installation directory where you want your new copy of Mono to be installed. Lets call that location PREFIX. Your Mono installation and its dependencies will be installed there. For example, I like to use the directory /opt/mono, so I would replace PREFIX with /opt/mono in the following discussion.

If you have more than one Mono installation (for example to keep multiple versions around), you will want to read the document on Parallel Mono Environments on how to keep your various Mono installations separate.

Читайте также:  Networking operating system windows

It is strongly advised not to install Mono from source in /usr as it might conflict with Mono as installed by the Mono package.

Building Mono

Building Mono is a very simple process as Mono has very few external dependencies.

On some distribution you will need to install some development tools which are not installed by default.

Compiler/Build dependencies

Mono depends on GCC 4.8+ or Clang 3.3+ (it needs to support C++11) and on CMake 2.8.10.

The table below shows a (not necessarily complete list) of the compiler versions in various distributions. Strikethrough means it doesn’t satisfy the version needed.

Distribution GCC Clang CMake
Debian 7 4.7/4.6 3.0 2.8.9
Debian 8 4.9 3.5 2.8.11
Raspbian 8 4.9 (?) 3.5 (?) 2.8.11 (?)
Ubuntu 12.04 4.6 3.0 2.8.7
Ubuntu 14.04 4.8 3.4 2.8.12
Ubuntu 16.04 5.3 3.8 3.5.1
CentOS 6 4.4 3.4 2.8.12
CentOS 7 4.8 3.5 (?) 2.8.12

Debian based distributions

On Debian based distribution you should guarantee that some packages are installed in order for the compilation process to succeed.
This can be done easily by using apt-get:

Note: if you are using Ubuntu 15.04/Debian 8 or later, you also need to install the libtool-bin package. Without it, you will get the following error: **Error**: You must have ‘libtool’ installed to compile Mono.

Building Mono from a Release Package

Mono releases are distributed as .tar.xz packages from the Mono web site. Once you have your dependencies installed all you need to do is run the following command where VERSION is the package version number and PREFIX is your installation prefix:

By the end of this process, you will have Mono installed on your PREFIX directory.

Building Mono From a Git Source Code Checkout

To build Mono from a Git Source Code checkout, you will want to have the official Mono installed on the system, as the build requires a working C# compiler to run. Once you do this, run the following commands, remember to replace PREFIX with your installation prefix that you selected:

Note that you have to have git installed on your distribution.

One Stop Shop Build Script (Debian)

If you are on a Debian system (Debian/Ubuntu) and you just want to install Mono without thinking too much, just cut and paste the following script, and enter your root password when requested:

This will by default install mono in /usr/local , but you can specify in the first argument of the script the directory of installation. /opt/mono or

/.mono/ might be a nice target as well.

After installing it successfully, read the notes on Parallel Mono environments on how to use the installed mono instance.

Источник

Как установить Mono в Ubuntu 20.04

Mono — это платформа для разработки и запуска кросс-платформенных приложений, основанная на стандартах ECMA / ISO. Это бесплатная реализация платформы .NET от Microsoft с открытым исходным кодом.

В этом руководстве описаны шаги, необходимые для установки Mono в Ubuntu 20.04.

Подготовка

В инструкциях предполагается, что вы вошли в систему как пользователь root или пользователь с привилегиями sudo .

Установка Mono в Ubuntu

Mono недоступен в стандартных репозиториях Ubuntu 20.04. Мы установим пакеты Mono из официальных репозиториев Mono:

Установите зависимости, необходимые для добавления нового репозитория через HTTPS:

Импортируйте GPG-ключ репозитория:

Результат должен выглядеть примерно так:

Добавьте репозиторий Mono в список источников вашей системы:

mono-complete — это мета-пакет, который устанавливает среду выполнения Mono, инструменты разработки и все библиотеки.

Установка может занять несколько минут. После завершения проверьте его, введя следующую команду, которая распечатает версию Mono:

На момент написания этой статьи последней стабильной версией Mono была 6.8.0.123.

Вот и все, Mono установлен на вашем компьютере с Ubuntu, и вы можете начать его использовать.

Начало работы с Mono

Чтобы убедиться, что все настроено правильно, мы собираемся создать программу Hello World, которая печатает классическое сообщение «hello world».

Откройте текстовый редактор и создайте файл hello.cs со следующим содержимым:

Используйте компилятор csc для сборки программы:

Приведенная выше команда создаст исполняемый файл с именем hello.exe .

Запускаем исполняемый файл:

Результат должен выглядеть примерно так:

Чтобы выполнить программу только путем ввода ее имени, установите флаг исполняемого файла :

Теперь вы можете запустить файл hello.exe , набрав:

Выводы

Установка Mono на Ubuntu 20.04 — относительно простой процесс, и он займет у вас всего несколько минут.

Если вы столкнулись с проблемой или хотите оставить отзыв, оставьте комментарий ниже.

Источник

Download

The latest Stable Mono release is: 6.12.0 Stable (6.12.0.122)

Please choose your operating system to view the available packages. Source code is available on GitHub (viewing only) or as a Tarball.

macOS Linux Windows Docker

Mono for macOS is available as a Mac Package (.pkg)

Please refer to the installation guide for more information about how to install and configure your Mono environment.

Supported on macOS 10.9 and later. Check the uninstall instructions if you want to remove Mono from your Mac.

* We recommend this package if you’re using Visual Studio for Mac since the stability of Visual Studio for Mac is only guaranteed with the Visual Studio channel releases.

1 Add the Mono repository to your system

The package repository hosts the packages you need, add it with the following commands.

Note: the packages should work on newer Ubuntu versions too but we only test the ones listed below.

Ubuntu 20.04 (amd64, armhf, arm64, ppc64el)

Ubuntu 18.04 (i386, amd64, armhf, arm64, ppc64el)

Ubuntu 16.04 (i386, amd64, armhf, arm64, ppc64el)

2 Install Mono

The package mono-devel should be installed to compile code.

The package mono-complete should be installed to install everything — this should cover most cases of «assembly not found» errors.

The package mono-dbg should be installed to get debugging symbols for framework libraries — allowing you to get line numbers in stack traces.

The package referenceassemblies-pcl should be installed for PCL compilation support — this will resolve most cases of «Framework not installed: .NETPortable» errors during software compilation.

The package ca-certificates-mono should be installed to get SSL certificates for HTTPS connections. Install this package if you run into trouble making HTTPS connections.

The package mono-xsp4 should be installed for running ASP.NET applications.

3 Verify Installation

After the installation completed successfully, it’s a good idea to run through the basic hello world examples on this page to verify Mono is working correctly.

Notes

Mono on Linux before 3.12 by default didn’t trust any SSL certificates so you got errors when accessing HTTPS resources. This is not required anymore as 3.12 and later include a new tool that runs on package installation and syncs Mono’s certificate store with the system certificate store (on older versions you had to import Mozilla’s list of trusted certificates by running mozroots —import —sync ). Some systems are configured in a way so that the necessary package isn’t pulled in when Mono is installed, in those cases make sure the ca-certificates-mono package is installed.

1 Add the Mono repository to your system

The package repository hosts the packages you need, add it with the following commands.

Note: the packages should work on newer Debian versions too but we only test the ones listed below.

Debian 10 (i386, amd64, armhf, arm64, armel, ppc64el)

Debian 9 (i386, amd64, armhf, arm64, armel, ppc64el)

2 Install Mono

The package mono-devel should be installed to compile code.

The package mono-complete should be installed to install everything — this should cover most cases of «assembly not found» errors.

The package mono-dbg should be installed to get debugging symbols for framework libraries — allowing you to get line numbers in stack traces.

The package referenceassemblies-pcl should be installed for PCL compilation support — this will resolve most cases of «Framework not installed: .NETPortable» errors during software compilation.

The package ca-certificates-mono should be installed to get SSL certificates for HTTPS connections. Install this package if you run into trouble making HTTPS connections.

The package mono-xsp4 should be installed for running ASP.NET applications.

3 Verify Installation

After the installation completed successfully, it’s a good idea to run through the basic hello world examples on this page to verify Mono is working correctly.

Notes

Mono on Linux before 3.12 by default didn’t trust any SSL certificates so you got errors when accessing HTTPS resources. This is not required anymore as 3.12 and later include a new tool that runs on package installation and syncs Mono’s certificate store with the system certificate store (on older versions you had to import Mozilla’s list of trusted certificates by running mozroots —import —sync ). Some systems are configured in a way so that the necessary package isn’t pulled in when Mono is installed, in those cases make sure the ca-certificates-mono package is installed.

1 Add the Mono repository to your system

The package repository hosts the packages you need, add it with the following commands.

Note: the packages should work on newer Raspbian versions too but we only test the ones listed below.

Raspbian 10 (armhf)

Raspbian 9 (armhf)

2 Install Mono

The package mono-devel should be installed to compile code.

The package mono-complete should be installed to install everything — this should cover most cases of «assembly not found» errors.

The package mono-dbg should be installed to get debugging symbols for framework libraries — allowing you to get line numbers in stack traces.

The package referenceassemblies-pcl should be installed for PCL compilation support — this will resolve most cases of «Framework not installed: .NETPortable» errors during software compilation.

The package ca-certificates-mono should be installed to get SSL certificates for HTTPS connections. Install this package if you run into trouble making HTTPS connections.

The package mono-xsp4 should be installed for running ASP.NET applications.

3 Verify Installation

After the installation completed successfully, it’s a good idea to run through the basic hello world examples on this page to verify Mono is working correctly.

Notes

Mono on Linux before 3.12 by default didn’t trust any SSL certificates so you got errors when accessing HTTPS resources. This is not required anymore as 3.12 and later include a new tool that runs on package installation and syncs Mono’s certificate store with the system certificate store (on older versions you had to import Mozilla’s list of trusted certificates by running mozroots —import —sync ). Some systems are configured in a way so that the necessary package isn’t pulled in when Mono is installed, in those cases make sure the ca-certificates-mono package is installed.

1 Add the Mono repository to your system

The package repository hosts the packages you need, add it with the following commands in a root shell.

Note: the packages should work on newer CentOS/RHEL versions too but we only test the ones listed below.

CentOS/RHEL 8 (x86_64)

CentOS/RHEL 7 (x86_64)

CentOS/RHEL 6 (x86_64, i686)

2 Install Mono

The package mono-devel should be installed to compile code.

The package mono-complete should be installed to install everything — this should cover most cases of «assembly not found» errors.

The package referenceassemblies-pcl should be installed for PCL compilation support — this will resolve most cases of «Framework not installed: .NETPortable» errors during software compilation.

The package xsp should be installed for running ASP.NET applications.

3 Verify Installation

After the installation completed successfully, it’s a good idea to run through the basic hello world examples on this page to verify Mono is working correctly.

1 Add the Mono repository to your system

The package repository hosts the packages you need, add it with the following commands in a root shell.

Note: we’re using the CentOS/RHEL repositories on Fedora.

Fedora 29 and later (x86_64)

Fedora 28 (x86_64)

2 Install Mono

The package mono-devel should be installed to compile code.

The package mono-complete should be installed to install everything — this should cover most cases of «assembly not found» errors.

The package referenceassemblies-pcl should be installed for PCL compilation support — this will resolve most cases of «Framework not installed: .NETPortable» errors during software compilation.

The package xsp should be installed for running ASP.NET applications.

3 Verify Installation

After the installation completed successfully, it’s a good idea to run through the basic hello world examples on this page to verify Mono is working correctly.

Mono for Windows is available as a Windows Installer file

Please refer to the installation guide for more information about how to install and configure your Mono environment.

Supported on Windows 7, 8, 10 or later.

GTK# for .NET

Installer for running Gtk#-based applications on Microsoft .NET:

Mono is available on Docker Hub

The simplest way to get started is:

This will download the latest Mono Docker image, create a container and put you into an interactive shell.

Available tags

There are several tags for selecting the desired Mono version:

  • latest — Always points to the latest release
  • X.X.X.X — points to a specific version, e.g. 5.8.0.108
  • X.X.X — points to the latest version in the X.X.X series, e.g. 5.8.0
  • X.X — points to the latest version in the X.X series, e.g. 5.8
  • X — points to the latest version in the X series, e.g. 5

The latest version, one minor version before that and the last version before a major version bump are periodically rebuilt by Docker Hub to pull in updates from the base Debian image.

All other version tags are still available, but won’t get those updates so you need to keep your images up to date by running apt update yourself. We encourage you to move to latest Mono releases as soon as they’re available.

Starting with Mono 5.2 we provide a slim variant (e.g. latest-slim ) which only contains the bare minimum to run a simple console app. You can use this as a base and add just what you need.

Release Notes

Check out the release notes of all Mono versions here.

MonoDevelop IDE

Please visit the MonoDevelop website for more details about our cross-platform IDE.

Older releases

To access older Mono releases for macOS and Windows, check the archive on the download server. For Linux, please check the «Accessing older releases» section in the installation guide.

Источник

Читайте также:  Обновления для windows 10 будут платными
Оцените статью