8

龙芯下如何进行.net core程序开发部署

 1 year ago
source link: https://www.cnblogs.com/silent2012/p/17474301.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

龙芯下如何进行.net core程序开发部署

  2022年4月,基础的运行时架构代码全部通过社区技术评审,。.NET国际开源社区正式宣布支持LoongArch(龙架构),目前LoongArch64架构已出现在.NET社区主干分支上。

  .NET 是一个免费的跨平台开源开发人员平台,用于生成许多不同类型的应用。使用 .NET,可以使用多种语言、编辑器和库来构建Web、移动、桌面、游戏和IoT。此次LoongArch架构得到.NET开源社区原生支持,意味着LoongArch64架构.NET会随着.NET开源社区同步发展,.NET开发平台的软件生态可以原生移植到LoongArch64平台部署运行,LoongArch生态建设再次迈出坚实一步,为国际开源软件发展注入中国自主创新源动力

  本文以.NETCore3.1在loongnix-server8.4下部署为例说明开发部署过程。

  .NETCore3.1是基于上游社区.NETCore3.1-LTS-SDK制作的,同样是LTS版本。

1、在龙芯开源社区下载安装.net core环境

wget http://ftp.loongnix.cn/dotnet/3.1.11/la64/dotnet-sdk-3.1.11-rc1-loongarch64.rpm

2、环境安装

rpm:
#安装:
$sudo rpm -ivh  dotnet-sdk-3.1.11-rc1-loongarch64.rpm
# 查看安装结果
$ rpm -qa | grep dotnet
dotnet-sdk-3.1.11-rc1.loongarch64
$ whereis dotnet
dotnet: /usr/bin/dotnet /usr/share/dotnet /usr/share/man/man1/dotnet.1.gz
#卸载:
$sudo rpm -e dotnet-sdk-3.1.11-rc1.loongarch64

正常安装后,配置如下:

[root@localhost opt]# dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.111
 Commit:    a9538e031d

Runtime Environment:
 OS Name:     loongnix-server
 OS Version:  8
 OS Platform: Linux
 RID:         linux-loongarch64
 Base Path:   /usr/share/dotnet/sdk/3.1.111/

Host (useful for support):
  Version: 3.1.11
  Commit:  02c4af85c9

.NET Core SDKs installed:
  3.1.111 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.11 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.11 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  http://www.loongnix.cn/

Loongson's .NET version:
  3.1.11-rc1

3、查看版本信息

dotnet --list-sdks
查看运行时版本:
dotnet --list-runtimes
详细信息:
dotnet --info

4、dotnet core程序编译

直接在windows系统进行通过vs编译的dotnet core程序,无法指定CPU为龙芯平台,所以需要将程序在龙芯平台上编译才可以进行。将程序拷贝到loongnix-server上,然后重新编译即可。如果为解决方案项目,直接将整个项目全部拷贝,然后cd到主项目下直接编译即可,编译命令如下。

dotnet build

5、编译成功后,程序在主目录的/bin/.../下,直接执行即可

dotnet xxxxxx urls http://*:8088

相关链接:

龙芯dotnet core的nuget源:https://nuget.loongnix.cn/

龙芯开源社区dotnet core频道:http://www.loongnix.cn/zh/api/dotnet/

龙芯dotnet core的github开源地址:https://github.com/dotnet/runtime/labels/arch-loongarch64

dotnet core runtime的github地址:https://github.com/dotnet/runtime/tree/main/src/coreclr/vm


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK