注册微软密钥和软件仓库,执行以下命令:
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
仅安装.NET运行时:
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y aspnetcore-runtime-8.0
安装.NET SDK(如果需要开发):
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-8.0
查看.net版本
dotnet -version
get请求接口:curl http://127.0.0.1:5000/api/test/hello
查看端口是否开通:lsof -i:5000
设置so打开目录:export LD_LIBRARY_PATH=/mnt/faceserver:$LD_LIBRARY_PATH
调试模式运行(会出现好多日志并且把日志输出信息都写到了txt文件内):LD_DEBUG=libs dotnet /mnt/faceserver/MicroService_Face_3_0.dll > debug_output.txt 2>&1