User219464869 posted
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" />
<authorization>
<deny users="?" />
</authorization>
<identity impersonate="true"/>
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)
Directory.CreateDirectory(varCreateDirectory & tempFileLocation_Sub1)
End If
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.