简体   繁体   English

如何安装 .NET Core o linux aarch64 Debain

[英]How to install .NET Core o linux aarch64 Debain

I m new to Linux and want to code some C# on Linux (for school).我是 Linux 的新手,想在 Linux(学校)上编写一些 C#。 The problem is I don't know how to install C#(I already read the instruction from Microsoft, but I don't get it working).问题是我不知道如何安装 C#(我已经阅读了 Microsoft 的说明,但我没有得到它的工作)。

'arm64' is the Debian port name for the 64-bit Armv8 architecture, referred to as 'aarch64' in upstream toolchains. “arm64”是 64 位 Armv8 架构的 Debian 端口名称,在上游工具链中称为“aarch64”。 The snapd daemon and tooling that enables snap packages is available for arm64 architecture in Debian.启用 snap 包的 snapd 守护进程和工具可用于 Debian 中的 arm64 架构。

To install snapd:要安装 snapd:

sudo apt update
sudo apt install snapd

Either log out and back in again or restart your system to ensure that snap's paths are updated correctly.注销并重新登录或重新启动系统以确保正确更新 snap 的路径。 After this install the core snap in order to get the latest snapd:在此之后安装核心 snap 以获得最新的 snapd:

sudo snap install core

C# is open source and cross platform now that Microsoft has released a version of .NET Core. C# 是开源和跨平台的,因为微软已经发布了 .NET Core 版本。 To install .NET Core in Debian open the terminal and type:要在 Debian 中安装 .NET 内核,请打开终端并键入:

sudo snap install dotnet-sdk --classic
sudo snap alias dotnet-sdk.dotnet dotnet # to run dotnet-sdk type dotnet

Run these commands to build and run an example C# Hello World console app from the terminal:运行这些命令以从终端构建和运行示例 C# Hello World 控制台应用程序:

cd ~
mkdir C#_Projects
cd C#_Projects
mkdir HelloWorld
cd HelloWorld
dotnet new console
dotnet build --output ./build_output  
dotnet ./build_output/HelloWorld.dll

Results of dotnet./build_output/HelloWorld.dll dotnet./build_output/HelloWorld.dll的结果

Hello, World!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM