I am trying to create a folder when I deploy my application and start it on my IIS8 but I am getting this error:
UnauthorizedAccessException: Access to the path 'C:\ApplicationsFolder\CentralApplicationSettings\' is denied.
This is the code in my Startup.cs:
var centralApplicationSettingsDirectory = System.IO.Directory.CreateDirectory(Environment.GetEnvironmentVariable(MSCASGlobals.CentralApplicationSettings));
When I deploy and start my application, the folder isn't created and when I try to start the application in my browser, I get the error above.
I have tried to give read/write permissions to my application pool identity already but it still doesn't work. What else am I missing?