Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. 2 web.config files in a project

2 web.config files in a project

Scheduled Pinned Locked Moved ASP.NET
windows-adminhelp
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hasanali00
    wrote on last edited by
    #1

    Is it ok to have web.conig files in subfolders of a project. so i can have project1/web.config and project1/folder1/web.config I tried the above, but go following error: Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. In my subfolder web.config, i have the following: thanks

    H M 2 Replies Last reply
    0
    • H hasanali00

      Is it ok to have web.conig files in subfolders of a project. so i can have project1/web.config and project1/folder1/web.config I tried the above, but go following error: Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. In my subfolder web.config, i have the following: thanks

      H Offline
      H Offline
      hasanali00
      wrote on last edited by
      #2

      somehow, my previous post did not show properly. it is missing following:

      V B 2 Replies Last reply
      0
      • H hasanali00

        somehow, my previous post did not show properly. it is missing following:

        V Offline
        V Offline
        VenkatFor NET
        wrote on last edited by
        #3

        It is perfectly alright to have more than one web.config. But for the error you get, there is some element in web.config related to authorization, you must not use. Please check. Am not able to recollect what it is. Bhaskara

        1 Reply Last reply
        0
        • H hasanali00

          Is it ok to have web.conig files in subfolders of a project. so i can have project1/web.config and project1/folder1/web.config I tried the above, but go following error: Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. In my subfolder web.config, i have the following: thanks

          M Offline
          M Offline
          minhpc_bk
          wrote on last edited by
          #4

          Hi there, Basically, you can use multiple Web.config files in multiple subfolders on an ASP.NET application, and each file is applied to its own directory and all child directories below it. However, you are only allowed to config the AUTHENTICATION settings at the application level, and any attempt to redeclare it in subfolders will result in an error as you see. For more information , you can see the documents: ASP.NET Configuration[^] authentication Element[^]

          1 Reply Last reply
          0
          • H hasanali00

            somehow, my previous post did not show properly. it is missing following:

            B Offline
            B Offline
            Brian M C
            wrote on last edited by
            #5

            It's definitely okay to have web.config files in sub folders. You have to be careful in the sub folders however. You can't change global application settings such as the session processing preferences or change the type of authentication for the website. You can add/override appSettings in the sub folder because they override the parent web.config. -BC

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups