ASP.Net using wrong web.config for virtual directory

Discussion in 'ASP .Net' started by Robin9876, Nov 13, 2008.

  1. Robin9876

    Robin9876 Guest

    In IIS 7 I have created a web site which is located at C:\MyWebSite
    and in IIS Manager created a virtual folder which points to C:
    \MyVirtualFolder. The virtual folder was then converted to an
    application using a separate application pool.

    However when accessing the virtual folder URL in a web browser it
    appears to be using the web.config of the root web site.

    What needs to change to allow the web.config in the virtual directory
    to be used?
    Robin9876, Nov 13, 2008
    #1
    1. Advertising

  2. Robin9876

    Joe Fawcett Guest

    "Robin9876" <> wrote in message
    news:...
    > In IIS 7 I have created a web site which is located at C:\MyWebSite
    > and in IIS Manager created a virtual folder which points to C:
    > \MyVirtualFolder. The virtual folder was then converted to an
    > application using a separate application pool.
    >
    > However when accessing the virtual folder URL in a web browser it
    > appears to be using the web.config of the root web site.
    >
    > What needs to change to allow the web.config in the virtual directory
    > to be used?

    I don't understand where C:\MyWebSite comes into it.

    --

    Joe Fawcett (MVP - XML)
    http://joe.fawcett.name
    Joe Fawcett, Nov 13, 2008
    #2
    1. Advertising

  3. Robin9876

    kghattas

    Joined:
    Nov 10, 2008
    Messages:
    10
    web.config should go in the physical folder C:\MyWebSite

    Regardless of virtual folder name, web.config always goes to the physical one.

    Khodr
    kghattas, Nov 14, 2008
    #3
  4. Robin9876

    kghattas

    Joined:
    Nov 10, 2008
    Messages:
    10
    web.config should go in the physical folder C:\MyWebSite

    Regardless of virtual folder name, web.config always goes to the physical one.
    kghattas, Nov 14, 2008
    #4
  5. Robin9876

    Robin9876 Guest

    In IIS the web site's file location is C:\MyWebSite and then the
    virtual directory was created in IIS on this web site with its file
    location as C:\MyVirtualFolder\


    On 13 Nov, 17:59, "Joe Fawcett" <> wrote:
    > "Robin9876" <> wrote in message
    >
    > news:...> In IIS 7 I have created a web site which is located at C:\MyWebSite
    > > and in IIS Manager created a virtual folder which points to C:
    > > \MyVirtualFolder. The virtual folder was then converted to an
    > > application using a separate application pool.

    >
    > > However when accessing the virtual folder URL in a web browser it
    > > appears to be using the web.config of the root web site.

    >
    > > What needs to change to allow the web.config in the virtual directory
    > > to be used?

    >
    > I don't understand where C:\MyWebSite comes into it.
    >
    > --
    >
    > Joe Fawcett (MVP - XML)http://joe.fawcett.name
    Robin9876, Nov 14, 2008
    #5
  6. Robin9876

    Robin9876 Guest

    I got this to work by adding the following (with a closing tag) to the
    root web.config
    <location path="." inheritInChildApplications="false">

    On 14 Nov, 10:05, Robin9876 <> wrote:
    > In IIS the web site's file location is C:\MyWebSite and then the
    > virtual directory was created in IIS on this web site with its file
    > location as C:\MyVirtualFolder\
    >
    > On 13 Nov, 17:59, "Joe Fawcett" <> wrote:
    >
    > > "Robin9876" <> wrote in message

    >
    > >news:...> In IIS 7 I have created a web site which is located at C:\MyWebSite
    > > > and in IIS Manager created a virtual folder which points to C:
    > > > \MyVirtualFolder. The virtual folder was then converted to an
    > > > application using a separate application pool.

    >
    > > > However when accessing the virtual folder URL in a web browser it
    > > > appears to be using the web.config of the root web site.

    >
    > > > What needs to change to allow the web.config in the virtual directory
    > > > to be used?

    >
    > > I don't understand where C:\MyWebSite comes into it.

    >
    > > --

    >
    > > Joe Fawcett (MVP - XML)http://joe.fawcett.name
    Robin9876, Nov 14, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dotnetprogram
    Replies:
    1
    Views:
    705
    Joey Powell
    Dec 27, 2003
  2. Wm. Scott Miller

    Web.Config and Virtual Directory

    Wm. Scott Miller, May 5, 2004, in forum: ASP .Net
    Replies:
    10
    Views:
    630
    Wm. Scott Miller
    May 6, 2004
  3. Raghu
    Replies:
    6
    Views:
    4,442
    Curt_C [MVP]
    May 27, 2004
  4. Benny Ng
    Replies:
    9
    Views:
    9,913
    Benny Ng
    Oct 13, 2005
  5. CSharpner
    Replies:
    0
    Views:
    1,001
    CSharpner
    Apr 9, 2007
Loading...

Share This Page