473,796 Members | 2,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple web.config files in a virtual directory

Is it possible to have multiple web.config files in a given virtual
directory in different directories? For example:

http://localhost/myapp (Virtual directory maps to C:\MyApp)
http://localhost/myapp/newFolder (web folder in the above virtual dir maps
to C:\MyApp\NewFol der)

Can I have one web.config file at C:\MyApp and another at
C:\MyApp\NewFol der? When I tried to do this, VS.NET web project (during
debugging) throws an errors saying that something is wrong at the server? So
I compiled the project and tried to bring to navigate to a page in the
browser (without debugging), I still get an error. But when I remove the
web.config file at C:\MyApp\NewFol der, it works fine.

Any help is appreciated.

Thanks.
Raghu/..
Nov 18 '05 #1
6 1852
yes, but you are limited what can be in the second one... usually thought
its better to have the ONE in the root and use the <location> tags to
explicitely handle things in the subfolders

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Raghu" <Ra***@nospamzz zqcsi.com> wrote in message
news:ui******** ******@TK2MSFTN GP12.phx.gbl...
Is it possible to have multiple web.config files in a given virtual
directory in different directories? For example:

http://localhost/myapp (Virtual directory maps to C:\MyApp)
http://localhost/myapp/newFolder (web folder in the above virtual dir maps
to C:\MyApp\NewFol der)

Can I have one web.config file at C:\MyApp and another at
C:\MyApp\NewFol der? When I tried to do this, VS.NET web project (during
debugging) throws an errors saying that something is wrong at the server? So I compiled the project and tried to bring to navigate to a page in the
browser (without debugging), I still get an error. But when I remove the
web.config file at C:\MyApp\NewFol der, it works fine.

Any help is appreciated.

Thanks.
Raghu/..

Nov 18 '05 #2
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:ud******** ******@TK2MSFTN GP10.phx.gbl...
yes, but you are limited what can be in the second one... usually thought
its better to have the ONE in the root and use the <location> tags to
explicitely handle things in the subfolders


Curt, what are the limitations on the web.config in the subfolder?

The only limitation I'm aware of is an issue with assembly references if the
sub-folder is also an application. If the main web.config uses

<httpModules>
<add name="MyModule" type="MyNamespa ce.MyModule, MyAssembly" />
</httpModules>

Then the subapplication will be looking for a SubApp\bin\MyAs sembly.dll. You
can add a <remove name="MyModule" /> to the sub-web.config, but it's already
too late - ASP.NET will be looking for MyAssembly.dll before it gets around
to processing your <remove>. The workaround is to place a dummy
MyAssembly.dll in SubApp\bin.
--
John Saunders
johnwsaundersii i at hotmail
Nov 18 '05 #3
Are you saying the SUB is flagged as an APP in VS?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"John Saunders" <jo************ **@notcoldmail. com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:ud******** ******@TK2MSFTN GP10.phx.gbl...
yes, but you are limited what can be in the second one... usually thought its better to have the ONE in the root and use the <location> tags to
explicitely handle things in the subfolders
Curt, what are the limitations on the web.config in the subfolder?

The only limitation I'm aware of is an issue with assembly references if

the sub-folder is also an application. If the main web.config uses

<httpModules>
<add name="MyModule" type="MyNamespa ce.MyModule, MyAssembly" />
</httpModules>

Then the subapplication will be looking for a SubApp\bin\MyAs sembly.dll. You can add a <remove name="MyModule" /> to the sub-web.config, but it's already too late - ASP.NET will be looking for MyAssembly.dll before it gets around to processing your <remove>. The workaround is to place a dummy
MyAssembly.dll in SubApp\bin.
--
John Saunders
johnwsaundersii i at hotmail

Nov 18 '05 #4
oopss... I mean IIS, not VS

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"John Saunders" <jo************ **@notcoldmail. com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:ud******** ******@TK2MSFTN GP10.phx.gbl...
yes, but you are limited what can be in the second one... usually thought its better to have the ONE in the root and use the <location> tags to
explicitely handle things in the subfolders
Curt, what are the limitations on the web.config in the subfolder?

The only limitation I'm aware of is an issue with assembly references if

the sub-folder is also an application. If the main web.config uses

<httpModules>
<add name="MyModule" type="MyNamespa ce.MyModule, MyAssembly" />
</httpModules>

Then the subapplication will be looking for a SubApp\bin\MyAs sembly.dll. You can add a <remove name="MyModule" /> to the sub-web.config, but it's already too late - ASP.NET will be looking for MyAssembly.dll before it gets around to processing your <remove>. The workaround is to place a dummy
MyAssembly.dll in SubApp\bin.
--
John Saunders
johnwsaundersii i at hotmail

Nov 18 '05 #5
I meant _if_ the sub is flagged as an app. The issue I raised only happens
if the sub is an app.
--
John Saunders
johnwsaundersii i at hotmail
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
oopss... I mean IIS, not VS

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"John Saunders" <jo************ **@notcoldmail. com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:ud******** ******@TK2MSFTN GP10.phx.gbl...
yes, but you are limited what can be in the second one... usually thought its better to have the ONE in the root and use the <location> tags to
explicitely handle things in the subfolders


Curt, what are the limitations on the web.config in the subfolder?

The only limitation I'm aware of is an issue with assembly references if

the
sub-folder is also an application. If the main web.config uses

<httpModules>
<add name="MyModule" type="MyNamespa ce.MyModule, MyAssembly" />
</httpModules>

Then the subapplication will be looking for a SubApp\bin\MyAs sembly.dll.

You
can add a <remove name="MyModule" /> to the sub-web.config, but it's

already
too late - ASP.NET will be looking for MyAssembly.dll before it gets

around
to processing your <remove>. The workaround is to place a dummy
MyAssembly.dll in SubApp\bin.
--
John Saunders
johnwsaundersii i at hotmail


Nov 18 '05 #6
Ah, yes. IF it's an "app" then all bets are off.
If it's not there are some things, like the security model/type that can't
be "re-set" in a sub web.config, only once in the root one.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"John Saunders" <jo************ **@notcoldmail. com> wrote in message
news:O5******** *****@TK2MSFTNG P10.phx.gbl...
I meant _if_ the sub is flagged as an app. The issue I raised only happens
if the sub is an app.
--
John Saunders
johnwsaundersii i at hotmail
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
oopss... I mean IIS, not VS

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"John Saunders" <jo************ **@notcoldmail. com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:ud******** ******@TK2MSFTN GP10.phx.gbl...
> yes, but you are limited what can be in the second one... usually

thought
> its better to have the ONE in the root and use the <location> tags to > explicitely handle things in the subfolders

Curt, what are the limitations on the web.config in the subfolder?

The only limitation I'm aware of is an issue with assembly references
if the
sub-folder is also an application. If the main web.config uses

<httpModules>
<add name="MyModule" type="MyNamespa ce.MyModule, MyAssembly" />
</httpModules>

Then the subapplication will be looking for a
SubApp\bin\MyAs sembly.dll. You
can add a <remove name="MyModule" /> to the sub-web.config, but it's

already
too late - ASP.NET will be looking for MyAssembly.dll before it gets

around
to processing your <remove>. The workaround is to place a dummy
MyAssembly.dll in SubApp\bin.
--
John Saunders
johnwsaundersii i at hotmail



Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
5322
by: Mike | last post by:
Looking to find any information on how to properly configure multiple instances of DB2. This is on Win2k db2 ver 7.2. I am basically looking for information on how the multiple instance settings should configured to work, how memory is shared or not, etc. I can not seem to find any good links to this information. Thanks, Mike
6
5515
by: Andrew Connell | last post by:
I have an app where I want virtually everything password protected/secure except for a single directory. That directory handles some custom authentication and contains my login form, but also some other pages that I need to make available to anon users. I've setup my web.config in the root directory to have the following included: <authentication mode="Forms"> <forms name=".ASPXFORMSAUTH" path="/"...
2
4664
by: James X. Li | last post by:
Is there a way to implement multiple login forms for ASP.NET applications? With our application we want to implement simple login form for normal resources (downloadable files), but more rigorous login forms for tasks like administration and configuration. The current ASP.NET seems only to allow to a single login form via the authentication element in web.config in the root directory. One work-around for our problem is implementing a...
5
10533
by: BPearson | last post by:
Hello I would like to have several sites share a single web.config file. To accomplish this, I would point the root of these sites to the same folder. Is there any reason why I might not want to do this? (IIS 5 or 6 In case you're wondering why I would do this, we have many web sites on a single server, and there are groups of sites that need to share common configuration information. I'd like to ease some administration by having one...
2
1752
by: Sean | last post by:
I have an ASP.NET web application that needs to be rolled out to a number of clients. The functionality is the same in all applications, but each client has its own database. At the moment, I have one application per client, but most of the files in the applications are the same, so this is not ideal from a maintenance point of view. The only differences between the client applications are:
10
3661
by: Wm. Scott Miller | last post by:
We have a intranet site that allows one of our departments to search a set of pdfs and then look at them. Only problem is that only they and us geeks should be allowed to see the pdfs. We have it locked down except for when a person directly types in the url to a pdf. Currently, the PDFs are in a virtual directory off the root of the server. Putting it under the search site also doesn't work. My understanding is that IIS looks as the...
5
11006
by: George | last post by:
Hi, Is it possible to specify the location of a web.config file in an ASP.NET application? I have one ASP.NET application which is to be hosted on 2 web sites in the same web server. I want to configure the 2nd web site as virtual directory so that the 2 web sites are pointing to the same application. However, there are different configuration settings for the 2 web sites, so that accessing these 2 sites' same ASP.NET application will...
5
1656
by: Sammy | last post by:
On a Windows 2003 Server machine that has multiple IIS web sites, how does one control which web site the new web application gets created under? Thank you, Sammy
3
3928
by: | last post by:
I'm seeking (probably basic) guidance on the right way to split a large site that's supposed to represent one domain(mydomain.org) into many small VS.NET projects, and how to avoid issues with multiple web.config files leading to the error: "It is an error to use a section registered as allowDefinition = 'MachineToApplication'"... I'm fairly new to VS.NET and my sloppy first solution was to make one huge solution/project with just one...
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10456
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10230
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10012
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7548
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.