Try our conversational search powered by Generative AI!

Access rights to virtual directory in iis

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!
Oct 21, 2008 15:08

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


Oct 22, 2008 9:12


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.

Oct 22, 2008 12:56
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.