Problems with impersonation


Vicente Flich

I have developing a web service that need to access files on Program Files
folder. I used write the tab <identity impersonate="true"/> in the web.config
file for the files outside the webservice folder can be accessed with a user
right correctly.

The problem is that if I use credentials of an user (of course with right to
acced to Program Files), the web service don't work, they report the next

System.InvalidOperationException: Error al generar el documento XML. --->
System.IO.FileLoadException: Acceso denegado: 'CarpinGestWS'.
Nombre de archivo: "CarpinGestWS"
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write12_ArrayOfStEmpresa(Object o)

If the I use an administrator user, the web service work fine. Finally, if a
try again with the user than firstly report the execption, then they work

Once I use the web service with an administrator acount, then all the users
can access the web service.

I think thes problem can be because any local security directive than not
permit an user load some DLL than the web service need, only administrators
can load it, and once an administrator load it, they can be accesed for the
users. But I don't know what directive is it, or what is the problem.

I have test my webservice on Xindows XP with IIS 5.1, also in Windows 2000
Server with IIS 5.0 and Server 2003 with IIS 6.0 and in three case i have the
same conclusion.

Anyone can help me?




Vicente Flich

I reply me :)

I just have fixed the problem. I find some other post in these newsgroup and
conclused the problem were that the user account that impersonate the ASP.NET
need full access to "C:\WINNT\Microsoft.NET\Framework\<version>\Temporary
ASP.NET Files folder" and others permisions and access rights (see complete
list in

Thank to these great newsgroup I solve the problem.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question