Solved

virtual directories in visual studio and IIS7

Posted on 2011-03-01
6
718 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

895 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

13 Experts available now in Live!

Get 1:1 Help Now