c# - "Could not find a part of the path" Error For File Read Operation in Azure App -


i built asp.net core api application deployed azure web api app. in code, try @ point read contents of file in content root, interpolating place holders actual values.

now on local system works fine cause able exact file path of file in cloud, exception following message:

could not find part of path...

i full file path so:

path.combine(hostingenvironment.contentrootpath, "containing directory\filename") 

but fails in cloud. there extras should know deploying or doing wrong respect understanding directory structuring in cloud deployment?

n.b store file in azure file storage container feel hassle read plus cost seeing file read quite often.

could not find part of path...

according exception, indicates there no related path in azure. if possible, remote debug azure web apps. file path. after use azure kudu(https://yoursite.scm.azurewebsites.net) tool check whether path existing.

enter image description here

if file path not existing, drag folder kudu tool directly or publish folder visual studio. after should work.

enter image description here

we more info azure web app sandbox. azure website file structure please refer document

/     logfiles         application             <instance>-<pid>-<ticks>.txt // application (nodejs/dotnet/php) traces         detailederror             errorpage####.htm // error details         git             trace                 trace.xml // trace generated during git deployments                 <instance>-<guid>.txt // kudu related traces             deployment                 <instance>-<guid>.txt // deployment related traces         http             rawlogs                 <logfile>.log     // iis http log. iis buffers , flushes every 60sec.         w3svc#####             fr####.xml            // iis fail request traces             freb.xsl     site         wwwroot             hello.htm             // files live in app         repository                // repo, including working files (i.e. not bare)             .git                 head, index , other git files         deployments             [commit id 1]                 log.xml           // deployment log, similar protal shows                 status.xml        // status of deployment (success/failure)                 manifest          // list of files deployed             [commit id 2]                 ...     .ssh         config                // contains config disable strict host checking         id_rsa                // private key in pem format         known_hosts           // known hosts have been accepted     data         jobs             triggered                 mytriggeredjob1                     20131112101559                         output.log                         error.log                         status              continuous                 mycontinuousjob1                     job.log                     status     siteextensions         // todo: add details here 

Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -