IIS - Virtual Directory Access on remote computers

Asked By dan scan on 18-Nov-11 02:06 PM
Short Question: I have two servers.  I only want one copy of content files to be available.  I made a virtual directory on server2 that points to server1 content.  Server2 can not see or modify the files on Server1 via the virtual directory.  I can browse the virtual directory from the browser and access the files all from server 2. But I can not read the files and folders via the System.IO.directory 


Long Question (Same as above but more detailed):
Situation: Old 1.1 application that should have very limited changes done to it.  (funding and testing).  The system needs to be load balanced to two servers.  The sticky sessions for the load balancer are fine.  But the system has some content that is uploaded and deleted from an application administrative page called the online library.  I would like to have all the content in one physical location.  A virtual directory would be the ideal solution.  The servers could each point to one physical location.

Current File structure of both servers:
/index.aspx
/onlinelibrary
/onlinelibrary/JobRole1/document.doc
/onlinelibrary/spreadsheet1.xls


The directory structure is looped through by using the System.IO.Directory.  This could be the issue as this might be using a way of looking through the files that goes by the local file system and not the virtual directory.  I can browse the structure from server2 when I set up the virtual directory on server1.  But the System.IO.Directory when it pulls the items can not find anything when access the onlinelibrary via the virtual directory.

Could this be a security issue (of course it could. so what should i make sure is set on each system)
Could this be a ~/onlinelibrary or a file call issue.
Could the wrong object (system.io.directory) be being used for this task.

Robbe Morris replied to dan scan on 18-Nov-11 03:17 PM
you'd need to use mapped drives if you want to access the files via the System.IO namespace.  You are currently storing your files on separate servers and use a pointer in IIS to manage the incoming http requests.  It does not magically handle local disk operations across servers too.
Neha Garg replied to dan scan on 18-Nov-11 09:54 PM
Hello dan,

TO achieve this you need to follow few steps, its a long process so click on the below link and read the process:

http://www.iislogs.com/articles/23/
Suchit shah replied to dan scan on 19-Nov-11 12:52 AM