c# - Access to the path is denied. google api local iis publish -
i'm having trouble getting access folders, when have validate authentication google user.
im getting error: access path '..' denied
when i've published locally on iis.
i tried change folder location, in app_data of project - no luck.
i have tried these guys doing, didnt well.
my code looks like:
string path = appdomain.currentdomain.basedirectory + @"\json\client_secrets.json"; using (var stream = new filestream(path, filemode.open, fileaccess.read)) { try { string googlecalendarpath = folderpath + @"\app_data\googlecalendar"; credential = googlewebauthorizationbroker.authorizeasync( googleclientsecrets.load(stream).secrets, scopes, _currentaccountno, //vær sikker på, @ dette er det samme altid, og er unikt, da ens permissions til google calendar bliver bundet op på dette! cancellationtoken.none, new filedatastore(googlecalendarpath)).result; } catch (exception ex) { return "cred. fejl: " +ex.getfullexceptionstring(); } }
, folderpath
server.mappath("~/app_data")
, , _currentaccountno
unique. cannot see i'm missing when following examples online, , can't see i'm doing wrong.
- thanks
try running visual studio admin mode.
Comments
Post a Comment