I'm developing a document repository using a .net core api project targeted for .net 7 and with minimal API. As a stopgap the uploaded files will be persisted as files to locally attached server filestore. Uploading files to the server as IFormFile works fine when I save them using the path returned from Path.GetTempPath()
which is c:\users\[user]\AppData\Local\Temp but I can't create any folders under that path or use any other path. It throws "access denied" or "cannot find a part of the path" errors, so I'm assuming it's permissions.
I've tried using a share and a UNC path, I've tried running Visual Studio as Admin and I even tried setting full control for IUSR, IIS_IUSERS and NETWORK SERVICE on the folder I want. I understand the server run by Visual Studio is Kestrel and it will almost certainly be hosted on that in production. How can I give my app permission to write to locally attached filestore folders (I need to show compartmentalization) while I am developing it, I don't want to spend too much effort on access as the aim is to eventually store files in Blob storage, but one is not available right now.