allowDefinition='MachineToApplication'

G

Guest

I have been looking around on different sites and fora, and i have a similar
problem than some people had before...
it is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error
can be caused by a virtual directory not being configured as an application
in IIS.

this is the solution i've read (almost everywhere)
"You need to create an application or a virtual directory ( with the IIS
Manager ) for the directory in which the code is placed."

Since I have several subfolders in my app, that would mean that I have to
make an application of every single folder?

There has to be another solution, or am I wrong ?
 
J

Juan T. Llibre

re:
Since I have several subfolders in my app, that would mean
that I have to make an application of every single folder?

No.

It means that if you have an application, you should not configure the
MachineToApplication settings in web.config's in the subdirectories.

All you have to do is set the MachineToApplication settings in your
Application's root, and they will be inherited in the subdirectories.

Solution :

Configure all MachineToApplication settings in your application's root,
and remove all MachineToApplication settings from your application's
subdirectories.
 
G

Guest

Well in the mean time I found a workaround in the machine.config
but had a bad feeling about it, because it seems a bit risky

thx
 
J

Juan T. Llibre

Hi, Boonaap.

Here's the main distinctions to keep in mind :

MachineToApplication settings in machine.config are machine-wide.
They affect *all* .net applications on the machine.

You can restrict MachineToApplication settings to *one* application
by making the settings in *that* application's web.config.

MachineToApplication web.config settings in any subdirectory
not configured as an Application throw the error you encountered.
 
Joined
Aug 22, 2007
Messages
1
Reaction score
0
Problem for forms authentication

Hi All,

I need to use different login forms for different folders with formsauthentication. So i am using different web.config for each folder. Now if i write authentication tag in any sub folder's web.config it shows this error.
I need it urgent, can u help.

Thanks in advance.


It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
 
Joined
Nov 17, 2009
Messages
1
Reaction score
0
Hi all, in my case this error was caused by having two web.config files in different locations within the project folders by accident.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top