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.




Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
 
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.




Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
 

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