G
Guest
I have an internal ASP.NET 2.0 web service that does, among other things,
expose a method that causes files to be written to a location that the user
configures. The web service has been around for a while, under ASP.NET 1.0
and it has just been updated to ASP.NET 2.0. The functionality in question
has not changed.
When testing the upgraded web service on Windows XP, I got an error when the
file was created:
Access to the path 'C:\MyFolder\myFile.ext' is denied.
This looks like a security issue, so I checked the folder permissions for
the ASPNET user (this is XP) and it had write permissions to the folder. I
tried adding the ASPNET user to the local administrators group on the
machine, to at least confirm that I have a permissions issue - the problem
did not go away.
Finally, I solved the problem by having the web service impersonate my
Windows Domain account. I added a line like the following to the web.config
file:
<identity impersonate="true" userName="domain\myName" password="myPassword" />
This solved the problem, but I don't understand why I had to do this and I
don't want this to be the final solution.
Does anyone understand what is going on?
expose a method that causes files to be written to a location that the user
configures. The web service has been around for a while, under ASP.NET 1.0
and it has just been updated to ASP.NET 2.0. The functionality in question
has not changed.
When testing the upgraded web service on Windows XP, I got an error when the
file was created:
Access to the path 'C:\MyFolder\myFile.ext' is denied.
This looks like a security issue, so I checked the folder permissions for
the ASPNET user (this is XP) and it had write permissions to the folder. I
tried adding the ASPNET user to the local administrators group on the
machine, to at least confirm that I have a permissions issue - the problem
did not go away.
Finally, I solved the problem by having the web service impersonate my
Windows Domain account. I added a line like the following to the web.config
file:
<identity impersonate="true" userName="domain\myName" password="myPassword" />
This solved the problem, but I don't understand why I had to do this and I
don't want this to be the final solution.
Does anyone understand what is going on?