2

. .

We have a growing need where web resources (files, documents, images, etc.) need to be shared between different web environments.

I'm looking into setting up symlinks to support this, but I don't know how to set it up. (Or would it be better to set up virtual directories? Part of my question is, what are current best practices to set this up?)

For example purposes, assume:

  • The environment is running on an IIS7 platform, and MUST be in a Windows environment.
  • The shared files need to be maintained using TFS.
  • The web sites occupy different sites on the same IIS instance and reside on the same physical server.
  • The sites are multple web platforms -- for example, one site is ASP.NET, while another is running classic ASP.
  • All sites are under the same corporate umbrella, which is why resources need to be shared.
  • All sites pull data from the same SQL Server database instance.

How would I set up a symlink to support this? Or, for that matter, are symlinks the best way to go about this?

Thanks in advance!

Edit: Addendum to the above example: my classic ASP environment can also include ASP.NET virtual subfolders. For example, I can have my domain www.somedomain.com running in classic ASP, but have a subdirectory (www.somedomain.com/dotnetapp) running as an ASP.NET application. The virtual directory used by the ASP.NET must be able to access the same file resources as the classic ASP environment.

Ray K.
  • 2,431
  • 3
  • 25
  • 39
  • I came across [**this link**](http://stackoverflow.com/questions/2992112/junctions-or-virtual-directories-for-web-applications), and found it to be helpful. – Ray K. Feb 26 '13 at 14:08

1 Answers1

3

On Windows virtual directories are more the standard way to do this. It also allows you to use IIS' virtual directory features and Windows/IIS rights management.

Erik Oosterwaal
  • 4,272
  • 3
  • 44
  • 64
  • That's what I was thinking, but I wanted to solicit some opinions and see how other people were doing it. Let me tinker a bit and see what I can do with it. Thanks for the feedback. – Ray K. Feb 26 '13 at 13:35
  • It's even possible to put the assets on a network drive/NAS. Rights management is a little more complicated in that case, you will need to create a network user and use that as the identity for your app pool to be able to access the files on the NAS. – Erik Oosterwaal Feb 27 '13 at 08:17