Solved

virtual directories in visual studio and IIS7

Posted on 2011-03-01
6
713 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
  • 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now