disabling web.config inheritance

A

apiringmvp

Hey everyone,

I have a config file issue. I have a website with a front in and a
back end. (eg. http://www.site.com/ and http://www.site.com/admin).
They are both written in .NET 2.0 using C#.

I am having conflicts on the web.config settings. my exact message
right now is:

"This application was precompiled with personalization turned off, but
it appears to have been turned on after the precompilation, which is
not supported. "

I am assuming that is occuring because, the root application doesn't
have any themes set up, while the admin site does. I am also have some
conflicts between connection strings, profile and membership providers,
because each site has a different one.

If I publish the two sites to different (eg. http://www.site.com/root
and http://www.site.com/admin) everything works, except the images
don't work because they are looking for ../product_images.

Question:

- is there a way to globally disable inheritance on themes/profiles
and membership settings? or force it to use the admin config over the
root?
- if not, is there a way to set the root site to theme="" and override
that in the admin?

- Ben Dewey
 
N

Nathan Sokalski

There is a way to prevent .config files at lower levels from inheriting. To
do this, place the part you want inside a <location allowOverride="false">
element (you must place the parent elements all the way up to <system.web>
inside the parent element as well). I have never used this feature, but it
sounds reasonably simple. The book that I learned it from (which I recommend
any ASP.NET 2.0 developer get even if they don't use this feature) is:

ASP.NET 2.0 Unleashed
by
Stephen Walther

This book has been like a gold mine for me ever since the day I bought it,
and it gives the examples in VB.NET and C#. I don't want to try to give you
too much advice on your problem since like I said, I've never used the
feature, but hopefully it will get you started.
 
A

apiringmvp

That didn't seem to work.

I tried:

<location path="admin/*" allowOverride="false">
</location>

<location path="admin/" allowOverride="false">
</location>

<location path="admin" allowOverride="false">
</location>

the first two throw an error saying it was an invalid format

the last still uses the web.config settings from the root dir.
 
A

apiringmvp

Well I figured it out.

My root site has a shopping cart stored in the profile. on the admin
site I had to override the profile setting by using

<profile enabled="false" />

now its working.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,781
Messages
2,569,619
Members
45,310
Latest member
FaustoMont

Latest Threads

Top