asp.net - System.UnauthorizedAccessException loading file from Disk -


Really strange problem in loading a file from a disk:
  string path =  Http consoles Server.MapPath ("~ / dataset / blob.xml"); File stream stream = new filestream (path, filemodel open);   

Exceptions:

One type of exception was 'System.UnauthorizedAccessException' in mscorlib.dll but it was not operated in the user code < P> Additional information: Path 'D: \ Webroot \ efob \ dev \ v1.0.x \ AFOB \ Datasets \ blob.xml' is denied access.

The strange thing is that it was working 5 minutes earlier. I checked the permission on the disk and have the right to read / write both as Debugger and ASPNET.

Thoughts?

Did you last open this section, then this section was disposed of:

  string path = httpNTtex Present. Server.mappath ("~ / dataset / blob.exml"); (Var stream = new filestream) {...}   

But in this case I suspect that this is really a permission problem. Can see from which process the file is trying to open and which account is processed under this process.

Comments