« Previous Next »

Thread: Place web app in IIS default website not virtual directory.

Last post 07-03-2004 6:28 AM by Ken Schaefer. 6 replies.

 

RSS

Page 1 of 1 (7 items)

Sort Posts:

  • 06-30-2004, 8:04 PM

    • GregD
    • Not Ranked
    • Joined on 06-26-2004, 9:37 AM
    • Posts 0

    Place web app in IIS default website not virtual directory.

    Is there a way of making a default website like a virtual directory?

    My current thinking is that a web app always has to be in a virtual dir if it has a web.config but in IIS this is not convenient at all.

    Im building a content management system for a company website and the bin file should be stored in the root of the directory. All the main files/web.config should also be stored in the wwwroot as well... index.aspx staff.aspx etc

    Otherwise all the main files will be like this online:

    www.domain.com/VirtualDirectory/

    rather than

    www.domain.com

    Why can't I use default website like a virtual directory? It has an application name but asp.net tells me its not a virtual dir so it cant use web.config.

    Ive tried referencing the default website home dir to the virtual directory but then lots of javascript errors started appearing in my asp.net pages.

    Any suggestions anyone?
  • 06-30-2004, 10:40 PM In reply to

    Re: Place web app in IIS default website not virtual directory.

    If you have make the vir dir an application, you should be able to run you app there. pls verify the vir dir settings.
    Cheers,
    Bernard Cheah
  • 07-01-2004, 12:31 AM In reply to

    • Ken Schaefer
    • Top 200 Contributor
    • Joined on 09-17-2002, 5:05 PM
    • Sydney, Australia
    • Posts 53

    Re: Place web app in IIS default website not virtual directory.

    Hi Greg,

    You certainly can store your application in the website's root folder.

    If you are using Visual Studio.Net to do your development, it prefers you to setup a virtual directory :-) However, you can use the "New Project in Existing Folder" option to create a project that's based in the root folder of a website.

    Cheers
    Ken
    Microsoft MVP - Window Server (IIS)
    MCITP (EA, SA), MCTS (ISA, SQL Server, Hyper-V, MOSS, Ops Manager), MCSE+Security, MCDBA
  • 07-01-2004, 6:39 AM In reply to

    • GregD
    • Not Ranked
    • Joined on 06-26-2004, 9:37 AM
    • Posts 0

    Re: Place web app in IIS default website not virtual directory.

    Ive worked out the problem. You have to copy the aspnet_client found in inetpub/wwwroot to whatever directory you are using for your website.... if you want your website as a default website rather than a virtual directory.

    This is because the requiredfieldvalidator needs to access the script in this directory... which explains all the javascript i was getting.

    I don't think it says this in the documentation for setup maybe MS should put it in if they havent already :)
  • 07-01-2004, 10:54 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Central NJ
    • Posts 7,651
    • IIS MVPs

    Re: Place web app in IIS default website not virtual directory.

    FWIW, VS.NET does not default to a "virtual" directory but rather one phsyically under the web root path. Instead of 'virtual", do you mean the folder should be set as an IIS application?
  • 07-02-2004, 9:52 AM In reply to

    • GregD
    • Not Ranked
    • Joined on 06-26-2004, 9:37 AM
    • Posts 0

    Re: Place web app in IIS default website not virtual directory.

    Effectively i wanted it so that the Web App was under default website rather than a virtual directory.

    But because i wasn't placing my webapp in /WWWROOT where aspnet_client is... my app would come up with javascript errors because i was using the clientside validation server controls.

    If i had put my web app in wwwroot it would have been fine but because it was in a seperate directory... when i changed the default website home directory to my directory the errors occured.

    If users are just going to use wwwroot for their website its no problem but if its a custom home directory you need to copy aspnet_client to it.

    Maybe just put something in the documentation saying "if you are using a custom directory and not the default wwwroot directory for your website make sure you copy the aspnet_client folder"

  • 07-03-2004, 6:28 AM In reply to

    • Ken Schaefer
    • Top 200 Contributor
    • Joined on 09-17-2002, 5:05 PM
    • Sydney, Australia
    • Posts 53

    Re: Place web app in IIS default website not virtual directory.

    You use the aspnet_regiis.exe tool to setup the necessary aspnet_client folders on all your websites.

    aspnet_regiis.exe /?

    for more information.

    Tom is also right that VS.NET does not put your projects in a virtual directory - it puts them in a subfolder that needs to be marked as an application root. That said, the other bit I was trying to get across (you can use "project in existing folder") is still valid.

    If you create a new website, or choose a new home directory for an existing website, then you use the aspnet_regiis tool with the -c option to setup the necessary aspnet_client folders.

    HTH

    Cheers
    Ken
    Microsoft MVP - Window Server (IIS)
    MCITP (EA, SA), MCTS (ISA, SQL Server, Hyper-V, MOSS, Ops Manager), MCSE+Security, MCDBA
Page 1 of 1 (7 items)