发布.net core网站时遇到 Access to the path '/root/.dotnet' is denied 错误

发布.net core时遇到 System.UnauthorizedAccessException: Access to the path '/root/.dotnet' is denied. ---> System.IO.IOException: Permission denied,这个错误是由于发布时设置的问题

正确设置为 self-contained linux64