views:

25

answers:

1

We have an application that is making use of the location tag in the web.config file at the machine level - meaning like C:\Windows\Microsoft.NET\Framework\v2.0...\CONFIG\web.config, the one that applies to the whole server - this application has lots of virtual directories under it and for each one there is a

<location path="IIS Web App Name\CustomerA">...

This seems to work ok for that app. But then we have a second app on the same server, and I'd like to add location tags to that app's web.config file - meaning the local web.config file in the app's directory - and have each one of them specify a location tag in a similar way.

Is this possible? Because it doesn't seem to work. I've tried:

<location path="My IIS App Name\CustomerA"> ...

and

<location path="CustomerA"> ...

and neither seem to work. I just need this location node to contain 1 node. Is there maybe some

A: 

Hey,

It would have to be a file or folder within that virtual. So I could set rules for "default.aspx" in the same root as the config file, or manage a folder like "Content" for the Content folder. I've done this successfully.

Or, put another config file in the folder you want to set custom rules for, and define rules there that will override the main...

HTH.

Brian
That makes sense. But we have 1 app that has 10 virtual directories. They all run the same code, but I want a different app setting value depending on the path. e.g. 'ourapp.com/CustomerA', 'ourapp.com/CustomerB'. Is this not possible in the app's web.config?
LoveMeSomeCode
I see what you are saying. Try creating a root web.config in the main virtual directory, and specify the path as CustomerA, do not include the domain as the path.
Brian
I tried that. It doesn't seem to pick it up. If I specify an appSetting node in the local web.config WITHOUT a location tag, that works, but I can't seem to override it.
LoveMeSomeCode