System.InvalidOperationException: Failed to map the path...

lakhi used Ask the Experts™
I am trying to set up some web pages. They are very simple, just listing out files in different directories and linking to them.

The directories are on another server on the network. There is a virtual directory called "F-Drive" on our main network server set up for this purpose

My problem arose when I tried to do a server.mapPath to bind the links to a gridview and I received the error mentioned above -  "Failed to map the path..."

This is the line it bombed out on:
Dim dirInfo As New System.IO.DirectoryInfo(Server.MapPath("/F-Drive/Departments/Test/Shares/Docs/TestDocs"))

I don't know if it's a permissions issue or a web.config setting.

I would appreciate any help wtih this.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You can use the Server.MapPath  only for the current virtual directory in which your web site/application is running.

For external directory and network paths you need to use the impersonation.

For more info in impersonation:

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial