/ dotnet

dotnetcore ubuntu

在 ubuntu 上部署 dotnet core 服务注意事项备忘。

安装就不用多说了,参考官方文档

如文档所做,在最后运行自动生成的 HelloWorld 项目时候会有一个迷之报错:

/usr/share/dotnet/sdk/2.1.105/NuGet.targets(465,5): error : Unable to obtain lock file access on '/tmp/NuGetScratch/lock/a38a3f4967b95dbabd7e27c7c402de0de9e0aaf4' for operations on '/home/ubuntu/.nuget/NuGet/NuGet.Config'. This may mean that a different user or administator is holding this lock and that this process does not have permission to access it. If no other process is currently performing an operation on this file it may mean that an earlier NuGet process crashed and left an inaccessible lock file, in this case removing the file '/tmp/NuGetScratch/lock/a38a3f4967b95dbabd7e27c7c402de0de9e0aaf4' will allow NuGet to continue. [/var/www/HelloWorldApp/HelloWorldApp.csproj]

意思大概是当前账户没有访问对应目录的权限,修改一下权限就好了。

sudo chmod 777 /tmp/NuGetScratch/lock/*

之前的守护进程是用 yum 安装的,Ubuntu 上面直接用 apt 安装

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install supervisor

守护进程的配置就参考之前的文章就可以了。