Last post May 01, 2014 05:24 AM by toon10
May 01, 2014 04:32 AM|toon10|LINK
I have an ASP.NET 2010 web application that runs from our company Intranet server which is an old Windows 2003 server.
The web app has a function which creates a sub folder on one of our network drives. The folder above is not shared. When I run the web app locally, this sub folder is created fine but when I run it after publishing it to IIS, I get an error saying access
to \\10.225.1.1\MyFolder\MySub is denied.
My app uses Windows authentication and allows impersonation.
My web.config code looks like this:
<authentication mode="Windows" />
<deny users="?" />
I have tried variations on this without success. I’ve trawled the web and have tried all of the suggestions but I just can’t seem to get it to allow access to create the folder.
Here’s my code on the submit button which works locally but not when live.
Dim varCreateDirectory As String = tempFileLocation & tempECNNumber
If Directory.Exists(varCreateDirectory) = False Then
Directory.CreateDirectory(varCreateDirectory & tempFileLocation_Sub1)
As a test, I even gave the MyFolder security permission of Full Control to “Everyone” and it still says access is denied. I’ve added security privileges of Full Control to “SYSTEM”, “NETWORK”, “ASP.NET” (which I believe is the credentials is supplies),
“IIS_WPG” and “NETWORK SERVICE” just to test but still nothing.
Has anyone got any suggestions on what I could be doing wrong? I’m not great with IIS or security but I’ve managed to get a very similar system running on the same server in the past without a problem. The only difference between the old system is that
I’m using a .NET 2 application pool for that which works and the new system uses a separate .NET 4 application pool.
May 01, 2014 05:04 AM|Dharmesh.Kotadiya|LINK
set an Admin Account in the <identity..> (user & pass) and see what happens.
<identity impersonate="true" userName="DMN\UserName" password="password" />
May 01, 2014 05:24 AM|toon10|LINK
Great Dharmesh, that worked.
I used my own acount as a quick test so I'll create an admin account and use that.
Thanks for taking the time to help out.