2 web.config files in a project
-
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
-
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
somehow, my previous post did not show properly. it is missing following:
-
somehow, my previous post did not show properly. it is missing following:
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
-
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
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[^]
-
somehow, my previous post did not show properly. it is missing following:
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