软件包 | dotnet-sdk-3.1.107-linux-x64.tar.gz |
---|
mkdir /opt/dotnet
tar zxf dotnet-sdk-3.1.107-linux-x64.tar.gz -C /opt/dotnet/
ln -s /opt/dotnet/dotnet /usr/local/bin/
echo 'export DOTNET_ROOT=/opt/dotnet/
> export PATH=$PATH:/opt/dotnet/
> export MSBuildSDKPath=/opt/dotnet/sdk/3.1.107/Sdks/' >> .bashrc
# MSBuildSDKPath 此条变量尤为重要,会在构建时找库文件
source .bashrc
# 查看版本信息
dotnet --version
3.1.107
# 查看具体配置信息
dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.107
Commit: 617a3e03f4
Runtime Environment:
OS Name: uos
OS Version: 20
OS Platform: Linux
RID: linux-x64
Base Path: /opt/dotnet/sdk/3.1.107/
Host (useful for support):
Version: 3.1.7
Commit: fcfdef8d6b
.NET Core SDKs installed:
3.1.107 [/opt/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.7 [/opt/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.7 [/opt/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
# 创建一个控制台程序
dotnet new console
# 运行 restore
dotnet restore
# 运行控制台程序
dotnet run
Hello World!
PS:龙芯开源社区已经有制作好的安装包直接安装使用即可
参考链接: