Link to home
Start Free TrialLog in
Avatar of najh
najhFlag for United Kingdom of Great Britain and Northern Ireland

asked on

virtual directories in visual studio and IIS7

I've been using ASP classic for years and have also dabbled with ASP.net, on and off.  However I'm really not brilliant at it and need a bit of help.


I have a server, running IIS7 and it has a website on there which has a load of virtual directories - the site seems to run fine and the virtual directories seem to do their job.  It's a development server - so stuff I do on there hasn't gone live.  My local computer has Visual Studio 2010 Professional.  I make edits to the development site using Visual Studio and I open the site using the File System method, (as opposed to Local IIS / FTP / Remote Site etc.)

The problem I'm having is that I can't see any of the virtual directories when I'm using Visual Studio from within the Solution Explorer.  Is it possible to? I hope I'm missing something obvious, but it's a bit of a pain because it means that when I look at the site in "Design" view in VS I don't get any of the images appearing, and I get a ton of errors because VS can't see the real site structure, even though when I look at the site with a browser it all works.  

First of all, does anyone have a clue what I'm talking about (if not I shall explain further) and more importantly, can someone point me towards what's going wrong with my set-up / or with the way I'm connecting / something!

Many thanks!
ASKER CERTIFIED SOLUTION
Avatar of ChetOS82
ChetOS82
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of najh

ASKER

Ahhh...

Yes, you're spot on - I'm creating a site hierarchy that doesn't exist in the file system.  Is this a BAD thing to do?  It feels bad so far because I can't edit the site very easily, and struggle with creating controls and things.  And in which case, how do people use virtual directories? Or do you avoid them where poss?

Originally I had a couple of virtual directories but then I realised there where two or more paths to each item in the website and thought, "oh that's bad - I'd better stop this from happening"  Maybe that was a wrong thought...
There are some good use cases for virtual directories, but they are usually for non-website related problems.  The problem you are having now is the main reason why they aren't used for website content or images.

Now, if you are combining several independent websites so they share a common root, then virtual directories are nice.  But you won't be attempting to share content across the sites in this case.

This would be something like:
http://domain.com/Sharepoint
http://domain.com/Extranet
http://domain.com/PartnerPortal

Where each site does something different but you want them all available under your primary domain.
Avatar of najh

ASKER

This is good stuff - what would someone who was doing such sites do?  Would each virtual directory actually be a separate web app with all associated stuff separated off so that they could administer those sites properly?

I feel so stupid for not getting this concept before but I suppose I thought virtual directories sounded a wonderful way to structure a website until i realised how completely unmanagable it seemed to be...
Yes, each virtual directory would be a separate site, they just share the common root.

There are other, more obscure, uses that are not as important any more.  One example is storing executable scripts (like Perl or C) in a separate virtual directory with different permissions.  But that isn't needed with ASP.net.
Avatar of najh

ASKER

Many thanks!