Access rights to virtual directory in iis

Vote:
 
I have a virtual directory in IIS mapped to a network resource. The virtual directory is set up to impersonate a different domain account when accessing this network resource. If I just use my web browser to browse to http://server/myvirtualdir/fileinvirtualdir everything works fine, but if I programmatically try to get the file data using VirtualPathProvider.OpenFile("/myvirtualdir/fileinvirtualdir") i get an access rights error on the network resource. Apparently VirtualPathProvider does not use the impersonating account. Is there an other way I can solve this? Thanks in advance!
#25335
Oct 21, 2008 15:08
Vote:
 

You have to run the application pool in IIS under a domain account that has access to the resource.

 

#25346
Oct 22, 2008 9:12
Vote:
 

Per,

thank you for your reply! However, this is exactly what I was hoping to skip by using the virtual directory and giving only that directory the domain user credentials necessary. But I suppose letting the application pool user access the network share the only way then.

#25354
Oct 22, 2008 12:56