Оказывается, с некоторых пор микрософтовскай язык C# и среда разработки .NET доступны на Ubuntu. Инструкция по установке здесь: https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu
Вот как выглядит установка на Ubuntu 20.10. Сначала добавляем Микрософт в список источников:
Вот как выглядит установка на Ubuntu 20.10. Сначала добавляем Микрософт в список источников:
Теперь устанавливаем нужные пакеты:wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
sudo wget -q https://packages.microsoft.com/config/ubuntu/20.10/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list
Проверяем версию:sudo apt-get install apt-transport-https sudo apt-get update sudo apt-get install dotnet-sdk-5.0
Попробуем скомпилировать что-нибудь простое на языке C#. Создаём традиционный проект 'hello world'.$ dotnet --info .NET SDK (reflecting any global.json): Version: 5.0.100 Commit: 5044b93829 Runtime Environment: OS Name: ubuntu OS Version: 20.04 OS Platform: Linux RID: ubuntu.20.04-x64 Base Path: /usr/share/dotnet/sdk/5.0.100/ Host (useful for support): Version: 5.0.0 Commit: cf258a14b7 .NET SDKs installed: 5.0.100 [/usr/share/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 5.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download
Смотрим исходник:mkdir helloworld
cd helloworld
dotnet new console
dotnet build
Запускаем:$ cat Program.cs
using System;
namespace helloworld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
Или так:$ dotnet run
Hello World!
Смотрим получившиеся бинарники:$ ./bin/Debug/net5.0/helloworld
Hello World!
Не уверен, есть ли смысл в C# под Линуксом, но прикольно.$ size ./bin/Debug/net5.0/helloworld ./bin/Debug/net5.0/helloworld.dll
text data bss dec hex filename
129591 4785 144 134520 20d78 ./bin/Debug/net5.0/helloworld
3080 0 0 3080 c08 ./bin/Debug/net5.0/helloworld.dll

no subject
Date: 2020-11-13 22:19 (UTC)no subject
Date: 2020-11-13 22:38 (UTC)no subject
Date: 2020-11-13 23:24 (UTC)суффикс Core отброшен
no subject
Date: 2020-11-13 23:17 (UTC)с .NET6 будет Android и iOS
no subject
Date: 2020-11-13 23:35 (UTC)no subject
Date: 2020-11-14 08:54 (UTC)no subject
Date: 2020-11-15 01:32 (UTC)no subject
Date: 2020-11-15 14:35 (UTC)no subject
Date: 2020-11-15 03:32 (UTC)no subject
Date: 2020-11-15 14:37 (UTC)