locked
Beginner Help RRS feed

  • Question

  • User1816990050 posted
    Hello All,

    I've been doing ASP.Net development for about 2.5 years now and still don't have much of a clue about whats going on with IIS.  I simply create and run my apps locally, let my server administrator know what I want, and then FTP my site wherever he points me.  But my lack of knowledge is starting to become a hassle due to my having to rely on the admin whenever I want to do something.  Could someone recommend a good starting point (book, website, article, etc)  for administering IIS or provide some basic principles for what is happening with IIS in regards to creating virtual directories for running ASP.Net apps.  I prefer to know the whole picture, besides just the .Net stuff, but those are my immdiate needs.  Thanks.

    Thursday, May 26, 2005 11:07 AM

All replies

  • User1416329745 posted

    If you write C# take a look at Programming .NET by Jeff Prosise he will walk you through creating a virtual directory and there are IIS MVPs on this site they will help you.  Try this link and download the IIS resource kit.  Hope this helps.

    http://www.iisanswers.com

    Thursday, May 26, 2005 11:33 AM
  • User1816990050 posted
    Thanks, I just downloaded the resource kit and I'll see what I can make of it.  I do have an immediate question I thought of after my original post though.  Why is it that you need a seperate virtual directory for each application?  I hope I'm wording that correctly, but it's a concept I don't understand.  Why can't I simply have my website with my root domain and then add subfolders and fill those with different apps as I go, I don't understand why each of those subfolders then needs to be configured as an application.
    Thursday, May 26, 2005 11:45 AM
  • User-1853252149 posted
    The IIS Administrator's Pocket Consultant by William Stanek is a good resource.  Also Administering IIS by Mitch Tullock.  Check Amazon or a bookstore near you.

    Jeff
    Thursday, May 26, 2005 12:33 PM
  • User-823196590 posted

    Don't confuse virtual directories with applications.  A virtual directory points to a folder that is not physically under the web root path.  The term is often (mistakenly) used to mean directories set as applications.

    You can have just subfolders under your root for your applications.  The application setting in IIS affects ASP and ASP.NET applications as it defines their scope for Application and Session variables, as well as which global.asa to use.

    Thursday, May 26, 2005 2:35 PM
  • User1816990050 posted
    I just don't understand why each application needs it's own virtual directory though.  Why can't there be one main virtual directory for your root folder, and then put all your seperate apps in subfolders beneath that root.

    Is this perhaps what the 'Add to Solution' option is for in VS.Net?

    Also, how are these things going to be effected when we go to ASP.Net 2.0.  Since there will no longer be "project" files associated with each app will they co-exist any better?

    Thursday, May 26, 2005 3:43 PM
  • User-823196590 posted
    Each application doesn't need it's own virtual directory.  Why do you think that they do?  You can have one main directory for your root folder, and then put all your seperate apps in subfolders beneath that root.  Each subfolder should be set as an application in IIS if you want it to maintain its scope, as I mentioned in my previous post.

    "Add to solution" just lets you manage multiple projects as a single solution.  It's not at all related to how IIS handles things.

    As far as 2.0, it will probably be very similar.  I haven't looked at it yet but I have to imagine that an ASP.NET application will live in a subfolder.
    Thursday, May 26, 2005 4:24 PM
  • User1816990050 posted
    I guess the reason that I think each app needs it's own virtual directory is because the only way I know to make something an app is by going into IIS, right-clicking the virtual directory for "Properties" and then naming the Application under the "Directory" tab.  Other than that I don't konw how to declare a subfolder an application. 

    Another thing I'm wondering about now though, since you can have all the apps under one virtual directory in subfolders are they able to share session info or is that lost when switching between apps?

    Friday, May 27, 2005 8:56 AM
  • User-823196590 posted
    I thought I had explained this already ... but ... setting a sub folder as an application is not the same thing as a virtual directory!

    On your second question - this is what I meant by scope.  Assume this folder structure (where root is C:\inetpub\wwwroot):

    Root (set as an app)
    -- folderA (set as an app)
    -- folderB (not set as an app)
    -- folderC (set as an app)

    In this case you have three applications - 1) everything in root and folderB, 2) everything in folderA, 3) everything in folderC.  You cannot share session info between the code in these applications.  FolderB is considered part of the application of its parent because it has no application setting for itself.  If you removed the application setting on folderC it would become part of the root application along with folderB.

    Does this help at all?
    Friday, May 27, 2005 11:25 AM
  • User1816990050 posted
    I guess the reason that I think each app needs it's own virtual directory is because the only way I know to make something an app is by going into IIS, right-clicking the virtual directory for "Properties" and then naming the Application under the "Directory" tab.  Other than that I don't konw how to declare a subfolder an application. 

    Another thing I'm wondering about now though, since you can have all the apps under one virtual directory in subfolders are they able to share session info or is that lost when switching between apps?



    Dont' freak out Tom, I got you the first time.  The first line of my reply said "the reason I think...".  I was just making the point that that was the only way I knew how to make anything into an app. 

    Secondly though, lets go back to your situation with root folder and subfolders a-c.  You say if you "removed " the application setting for subfolder c it would fall into the scope of the root folder and subfolder b.  How would you remove that application setting?  Simply in IIS?  Would you have to remove any files (Global.asax, etc)?  How does this affect Namespace?
    Friday, May 27, 2005 11:35 AM
  • User-823196590 posted
    You would remove the setting in IIS by bringing up the properties dialog for the directory and click on the "Remove" button in the Application Settings section.  Global.asax would be ignored and I honestly don't know how it would affect the namespace.  I've never had a reason to actually do this and my example was only for illustration.  I don't see a practial reason for doing that.
    Friday, May 27, 2005 3:34 PM
  • User-1853252149 posted
    I guess the reason that I think each app needs it's own virtual directory is because the only way I know to make something an app is by going into IIS, right-clicking the virtual directory for "Properties" and then naming the Application under the "Directory" tab. 

    That makes your virtual directory an app.  But you don't have to have a virtual directory, you could just have a subfolder off your web root folder and do the same thing.  Virtual directories are "fake" directory entires that point to a directory somewhere else, often outside of the web site's folder structure.  An application can be a virtual directory, but it doesn't need to be.  Just because you make a folder an application root doesn't make it a virtual directory.  So:

    c:\inetpub\   <===  Web Root
    c:\inetpub\app1   <=== Subfolder, set as an application
    c:\inetpub\folder1   <=== Subfolder that is not an application
    c:\applications\app2   <=== Application folder that isn't in your web site's folders

    For the last one to be accessible on your web site, you need to create a virtual directory that points to it.  App1 is an application, but not a virtual directory.

    A common method of combining applications on your web site is to make the root of your site the only application folder and use subfolders under it for each separate applictaion.  So you might have:

    \\InetPub\
    \\Intepub\App1
    \InetPub\App2

    Only \\InetPub needs to be an application in IIS.  In VisualStudio you set each application to its folder, as in App1, App2, etc.

    Jeff
    Friday, May 27, 2005 4:31 PM
  • User-823196590 posted

    Why did anyone ever start calling folders set as applications "virtual directories" anyway?  It's just plain wrong.  :)

    Friday, May 27, 2005 5:52 PM