allowDefinition="MachineToApplication"

G

Guest

Can you clarify use of the Section allowDefinition="machineToApplication". I
have copied the definition from the MSDN documentation further down below.
In this definition it says..."....This excludes Web.config files in virtual
directories or a physical subdirectory in the application..."

My question is .... Since virtual directories can also be ASP.NET
applications ... when does the exclusion apply ? I have had problems having
multiple occurences of selected section types when multiple ASP.NET
applications are defined.

Please clarify.

==========

MachineToApplication - Allows the section to be configured in one of the
following files:

- Machine.config.
- Root Web.config.
- Web.config for an application.

This excludes Web.config files in virtual directories or a physical
subdirectory in the application.
 
M

MSDN

Is the virtual directory in IIS set up as an application.
Just open IIS and goto the properties for the Virtual directory and click
the Create Button.
I don't know if that can help you.

Sa
 
J

Juan T. Llibre

Virtual directories are not Applications.

Virtual directories are mappings of URLs to physical directories for the web server.
Application roots are independent of this and are the "root" location for a specified application.

Properties defined as allowDefinition="MachineToApplication" can
*only* be configured for Applications, and can't be configured for virtual directories.

If you open the file "machine.comments" in the CONFIG subdirectory
of the .Net Framework 2.0 directory, you'll see which sections they are.

There's two types of "allowDefinition" restrictions :

1. allowDefinition="MachineOnly"

These can only be set in machine.config

2. allowDefinition="MachineToApplication"
These can be set in the web.config in the root of an application.

The rest ( the properties without one of those 2 restrictions) can be set in any web.config.




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 

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

Top