I'm experimenting with syncing photos between two cloud providers, first I wanted a local list of photos on my Mac.
I'm using .Net 5 on MacOs
However, Big Sur is preventing my app from accessing the Pictures directory, .Net is giving me a System.UnauthorizedAccessException.
How do I allow my .Net application access to the full hard drive on a Mac ?
Code below, I can quite happily hit Documents with this code, but Big Sur doesn't like me accessing Pictures.
using System;
using System.IO;
namespace FindFiles
{
class Program
{
static void Main(string[] args)
{
var x = Directory.GetFiles("/Users/paul/Pictures", "*" , SearchOption.AllDirectories);
Console.WriteLine(x.Length);
}
}
}
Thanks