最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - Unable to create files from dotnet processes in Mac - Stack Overflow

programmeradmin3浏览0评论

I have had weird problems with development in my Mac for a while. It must have to do with some recent OS update. It started with ASP.NET being unable to write some keys to project folder, and then build processes leaving empty files in obj folder. And then EF Core tools refused to work and threw up file access exceptions. I've left many questions here, and created an issue in EF Core's github.

I finally did an experiment and tried to simply create a file from .NET code: var file = File.Create("test.file"); and I get an exception Unhandled exception. System.UnauthorizedAccessException: Access to the path '/Users/myuser/dev/repro-ef/test.file' is denied.

I can create a new file with the same user in the same directory in terminal with no problems. dotnet new will happily write files to my dev folder.

I've been trying to find any system settings related to this, and turned on "Full Disk Access" to the /usr/local/share/dotnet/dotnet executable. Did not help.

Does anybody have same problems? What permissions do I need to change?

发布评论

评论列表(0)

  1. 暂无评论