1

I've seen many answers regarding permission issues but could not find an answer to this. I am developing a MVC ASP.NET application using Visual Studio 2015 and integrated local IIS Express (v. 10, I guess). As a matter of fact I can read, write, create and delete files but can't create a new folder.

Who is the ASP.NET request identity in this environment?

Also note there is no possibility to add ASP.NET user to file permissions in my Windows 10 Professional.

Which is the present IIS Express user that it is allowed to write/delete files but not to create directories?

I also tried changing Windows Authentication from disabled (default) to enabled in Project Properties plus several others modifications but none of them helped.

I am really stuck on this so thanks in advance for your time and consideration.

Suhaib Janjua
  • 3,538
  • 16
  • 59
  • 73
Luke
  • 399
  • 4
  • 17
  • _Can't_ reproduce **locally/VS**. How are you creating the folder? Is it the right path? Is it a valid path? Locally, VS runs as "you". Refer to [this](https://www.iis.net/learn/manage/configuring-security/application-pool-identities) on server/other machines/live. Hth... – EdSF Feb 18 '17 at 20:16
  • System.IO.Directory.CreateDirectory(pathString); Exception: {"Access to the path '~/Content/ProductImages/15' is denied."} There's nothing wrong with '~/Content/ProductImages' as it is the folder I used to save image up to now. I'm now trying to create the '15' subfolder (I need to create different folder for each product). – Luke Feb 18 '17 at 20:32
  • I ended up disabling inheritance for parent folder for my account as it seems to be the identity used by IIS Express as suggested. That solved. Thanks. – Luke Feb 18 '17 at 21:24
  • That's (`~/`) not a "path" that [`System.IO.Directory`](https://msdn.microsoft.com/en-us/library/54a0at6s(v=vs.110).aspx) "understands" - it has to be a _physical path_ ...so unsure how you got it to work.... – EdSF Feb 19 '17 at 01:23
  • @EdsF. You are right, that was the real problem. I erroneously thought I could manage files saving and creating folder the same way. – Luke Feb 19 '17 at 22:39

0 Answers0