Solved

virtual directories in visual studio and IIS7

Posted on 2011-03-01
6
723 Views
Last Modified: 2013-11-26
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!
0
Comment
Question by:najh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 18

Accepted Solution

by:
ChetOS82 earned 500 total points
ID: 35008686
If you are using virtual directories to create a site hierarchy that doesn't exist in the filesystem, which is sounds like, then you will continue to have this problem.  Visual studio doesn't understand virtual directories.

Ideally, the structure you have created with virtual directories would be mimiced in the file system, and then you could get rid of the virtual directory.
0
 
LVL 10

Author Comment

by:najh
ID: 35008768
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...
0
 
LVL 18

Expert Comment

by:ChetOS82
ID: 35008880
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Author Comment

by:najh
ID: 35008928
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...
0
 
LVL 18

Expert Comment

by:ChetOS82
ID: 35009008
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.
0
 
LVL 10

Author Closing Comment

by:najh
ID: 35009034
Many thanks!
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question