Using multiple web.configs with different web apps in the same web folder.

How do I tell a web application to use a specific web.config file instead of referencing the root web apps web.config file?


Example: In IIS i have this setup:

My Server
  Web Sites
     Default Web Site (this has web.config with a reference to a HTTP Handler)
     My Http Handler
           My Sub Web
             < --- This sub web is looking for the http handler in this web

hope that makes sense.




11/3/2006 5:17:47 PM 91979 articles. 3 followers. Follow

6 Replies

Similar Articles

[PageSpeed] 18

use location element in webconfig..,location element controls authentication issues of subfolders, pages..etc

<location path="AppName/sub">

         <allow users="?" />

My Blog

"Don't be afraid to be wrong; otherwise you'll never be right."
11/3/2006 7:54:02 PM

So does the <location> tab go in the Root web.config or the sub application? Say my main application needs this line in the web.config:


                        <add directoryName="VBCode" />

In my SUB WEB APP what can I add to Ignore this (because it will look for the "VBCode" folder in the sub web app).


Thank you.   


11/3/2006 8:48:27 PM

i am assuming you have sepearte folder for each application. Place the corresponding webconfig files in that folders.

the reason i suggested <location> element is you are not allowed to use Authentication section any where but the Root of the Application Folder.

My Blog

"Don't be afraid to be wrong; otherwise you'll never be right."
11/3/2006 9:31:56 PM
Yes the sub webs are in different folders. And currently each folder does have its own web.config... im still not sure if I understand what you're saying...

11/3/2006 10:14:06 PM

Since you have web.config in each subfolders, the web pages in that sub folder use the configuration settings mentioned in the web config file placed on that sub folder.. Each sub folder web configuration settings over ride the configuration settings from the root web config file, which inturn over ride the configuration settings from the machine.config..its an heirarchical approach

Kumar Reddi
11/5/2006 7:17:12 AM

I see what you're sayign but I'm not sure if it applies to my problem.

My ROOT web.config has this line in it:

                        <add directoryName="VBCode" />

 The sub webs (sub folders) in my web application DO Have their own WEB.CONFIG file. Their web.config fiels do NOT have this code in the web.config, but it is still looking for this folder. Do i need to implicitly tell it not to look for it? Or not to inheirt from the root web.config?




-- shawn

11/10/2006 11:22:59 PM

Similar Artilces:

Using Multiple Web.Config for mutliple web apps sharing a web site as virtual directories
I have a web site on IIS 6.0 Windows 2003 Server. I have created several virtual directories to point to other .net projects that I wish to use in the website. The main site, which was made in C#, has a line in the web.config that allows the use of VB by defining a speical code directory. Now, when I attempt to use the other applications they throw this error. It looks like they are all sharing the main web.configParser Error Message: The code subdirectory '/Forum/App_Code/VBCode/' does not exist.Source Error: Line 62: <!-- for SIP forum -->Line 63: <codeSubDirect...

web web web
Name: bahadir Email: Product: Firefox 2 Beta 2 Summary: web web web Comments: web sayfası yapmak Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.8.1b2) Gecko/20060821 Firefox/2.0b2 ...

How do I merge web services' app.config with web app's web.config? Help!!
I have a web application project that uses a separate class library containing web service references (service layer). I want to be able to configure the web reference URLs dynamically and I know you can set this up by setting the URL behavior to  'Dynamic', etc, etc. The problem is VS2005 puts the URLs in the project's app.config file. When the class library becomes a DLL component, I have no way of accessing the app.config file.Is there a way to make the web reference project to look for the URLs in the web.config instead of its app.config? Or is there a way to merge this app.config w...

How to use a web user control from one web app in another web app?
I have a production web app project (at work) that has custom web user controls in it.I have another web app project for experimenting and I want to use some web controls from the production web app. The big trick is that I need to load the controls dynamically.LoadControl() doesn't seem to work - it complains about loading controls from a different application. I also tried adding a project reference to the production web app and using "UC1 newUC = new UC1();" and then "this.Controls.Add(newUC);", but the controls (like TextBoxes) on the web user control don't seem to exist on the new UC1s....

how to get the access to modify web.config when running web app?
hi all, I am working on a web app that modification to the web.config may be needed when user logs on as administrator. when user logs on as an administrator, s/he cold choose to change some settings in the web.config. My question is, how to grant the permission of "modify" web.config to this kind of user? I know that all the user access the resources through "anonymouse access", and they use account "XXX\Iuser_XXX" to access the web.config, but this account (or user group) has no access "modify or write" to web.config. When used, the user must have the write perm...

Web App connecting to database using web.config file
I am using the web.config file to store my database connection string. Everything was working fine when I was running to applicaiton on my local machine. However, when I deployed to the web I keep on getting this error: System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open() at Dev_verI.Basi...

Run Web app using Web Harpoon
Does anyone know what Begin Tag and End Tag to use to run a VB.Net web App in Web Harpoon? We are experiencing errors trying to run the app. Error --> The state information is invalid for this page and might be corrupted Thanks,   Erik...

Why we use Web.Config File for connection string wether we can use class Library for get connection for whole web Application
 Why we use Web.Config File for connection string wether we can use class Library for get connection for whole web Application  please help me? Friend, Web.config has its own advantages. 1) Web.Config is used to store the important information like connections strings that it can be modified even after the code has been    deployed to the server without compiling the entire application again. 2) Since it is a XML file, there is no need of building the project of you are going to change the connection strings.   If you go for the class files,...

Changing URL in web.config for web service
I added a web reference to asmx file. In web.config - it adds - undefinedadd key="CoreService.CoreServices" value="http://test/CoreServices.asmx I then change it to <add key="CoreService.CoreServices" value="http://test2/CoreServices.asmx"/> But CoreService.CoreServices still looks for http://test/CoreServices.asmx.  What else do i have to change? I think CoreService.CoreServices are hard coded into the source code.  Girijesh I think CoreService.CoreServices are hard coded into the source code.  Girijesh So no ...

Web Apps vs. Web Sites (was: Universal Navigation for Web Apps)
On Wed, Mar 14, 2012 at 12:58 PM, Justin D'Arcangelo <>wrote: > there needs to be a differentiation between > web sites and web *apps*. > While we might be able to describe characteristics that conceptually separate a "web site" from a "web app", I think in reality they will exist on a continuum. Chris Jones is right that we need more data from actual app developers on this, but I can provide some anecdotal evidence by telling the story of a web app I worked on which got listed in a web app store. I worked on a web-b...

running 2 web.configs in the same website 1 in /web.config and one in /swf/web.config
Im having issues doing this. and when i remove the authentication from the swf/web.config it still doesnt seem to be applying to the child website at all. Whats the proper way to set a child website? Thanks!!  The lower most web.config overrides all previous settings. So if you remove the section from the /swf/web.config whatever settings you have in the web.config in the next higher level will have an effect on the content of the child folder.So instead of removing a section, try giving appropriate settings in the /swf/web.config....

Use web.config with web forms?
 Hi All, I'm doing some unit testing of a web application, and would like to use settings from a web.config file.  Is this possible? Thanks much,- Mark I'd suggest keeping your Unit Tests in a seperate project and using it's own .config file. It will be a little repetition but it will help to keep things seperated for perf and reusability without bloating your production app. I agree with Curt. It is better to seperate options for testing and release version. This will decrease the job to be done once the unit testing process is finished.Haissam Abdul Mal...

web app with multiple web services
Hi all, I intend on having a web app which would have many .asmx files. Some would be atlas web services and some would be regular web services. I noticed that in the web.config it changes the httphandler for .asmx files. Will this affect all my .asmx files? Is there anyway to restrict this based on folder paths etc?TIA! Yes, you can restrict handlers to specific files or directories. Please note that even though the .asmx requests are now handled by a different handler, it should not break anything. All this handler does is return a JavaScript proxy when someone requested the service...

How to get new web app to use .NET 2.0 on Win2K server using .NET 1.1 as default framework?
I have .net framework1.1 and 2.0 on our server running win2K. i have existing applications that uses 1.1, i also have a new app that use 2.0.  how can i set my new .NET 2.0 app to point to 2.0 without messing up my existing .NET 1.1 apps? To specify the ASP .Net version fro a web application, do the followingIn IIS Manager select the web application -> Properties -> ASP.Net TabSelect  ASP.Net version you want to use for the applicationRegards,PrashantDont forget to click "Mark as Answer" on the post that helped you. But I am running Win2K...

Web resources about - Using multiple web.configs with different web apps in the same web folder. -

San Bernardino gunman and female accomplice dead in live TV shoot-out
The shooting occurred just before 11am at the Inland Regional Center in San Bernardino during a Christmas party for county employees.

Peter Jackson Sets Turkish Court Straight On ‘Lord Of The Rings’ Lore Error
When you need help with something, you need to turn to the biggest expert you can find, probably a huge geek. That’s especially true in a case ...

Disney updates Star Wars: Commander with ‘The Force Awakens’ content
With just a couple of weeks to go before the highly anticipated theatrical release of Star Wars: The Force Awakens, Disney has gone full Force ...

How Zuckerberg's LLC Could Be More Effective Than Charity
Mark Zuckerberg took a page out of his "hero" Bill Gates' book on Tuesday when he unveiled his new philanthropic group, but the Facebook CEO ...

Google refute’s EFF’s “spying on students” allegations
This is quickly going to be a he/she said, he/she said case. Google has naturally responded to privacy watchdog EFF's accusations that the search ...

Conservatives In Congress Vote To Deny Climate Change
Earlier we mentioned that the House voted to authorize unconstitutional domestic spying on American citizens yesterday. The day didn't get any ...

Yahoo To Sell Core Business? Board Explores Sale Of Internet Assets
Yahoo Inc. will consider selling the company’s core internet business, with the possibilities being discussed in a series of board meetings being ...

Latest ‘Batman v Superman’ Trailer Sees Ben Affleck and Henry Cavill Face Off in Epic Style
The latest trailer for “Batman v Superman: Dawn of Justice” premiered on Wednesday night, and the teaser kicked off with a chilly first meeting ...

Texas sues US, relief agency, to block Syrian refugees
Reuters Texas sues US, relief agency, to block Syrian refugees Reuters AUSTIN, Texas A Texas state agency sued the U.S. State Department, ...

Black Friday Frenzy Scrambles Home-Video Sales Ranking
The annual Black Friday sales frenzy once again turned the national home video sales charts into a free-for-all, with deeply discounted recent ...

Resources last updated: 12/3/2015 7:31:30 AM