You may get this error when trying to browse an asp.net application. The debug information shows that "This error can be caused by a virtual directory not being configured as an application in IIS." However, this error occurs primarily out of 2 scenarios. 1.
When you create an new web application using visual studio.net, it automatically creates the virtual directory and configures it as an application. However, if you manually create the virtual directory and it is not configured as an application, then you will
not be able to browse the application and may get the above error. The debug information you get as mentioned above, is applicable to this scenario. To resolve it, Right Click on the virtual directory - select properties and then click on "Create" next to
the "Application" Label and the textbox. It will automatically create the "application" using the virtual directory's name. Now the application can be accessed. 2. When you have sub-directories in your application, you can have web.config file for the sub-directory.
However, there are certain properties which cannot be set in the web.config of the sub-directory such as authentication, session state (you may see that the error message shows the line number where the authentication or sessionstate is declared in the web.config
of the sub-directory). The reason is, these settings cannot be overridden at the sub-directory level unless the sub-directory is also configured as an application (as mentioned in the above point). Mostly we have the practice of adding web.config in the sub-directory
if we want to protect access to the sub-directory files (say, the directory is admin and we wish to protect the admin pages from unathorized users). But actually, this can be achieved in the web.config at the application's root level itself, by specifing the
location path tags and authorization, as follows:-
However, if you wish to have a web.config at the sub-directory level and protect the sub-directory, you can just specify the Authorization mode as follows:-
Thus you can protect the sub-directory from unauthorized access. Cheers.
when i move web.conf file from subdirectory to root.This error is gone [:)].But i want to keep the config file in subdirectory only i tried all those methods given in last post .but no use .pl help me[:(]
You cannot keep the web.config only in the sub-directory. You need to have a web.config in the root directory. If at all you want to have a web.config in the sub-directory, then the only settings you can specify are authorization, appsettings etc.,
Unless you configure the sub-directory also as an application in the IIS Virtual directory settings, you cannot have any other settings such as authentication, session-state etc., in the web.config that you have in the sub-directory.
I had the same error and solved it by doing the following:
Give your virtual directory an Application Name that does not have dots (.) in the name. To make sure you are not having naming issues, give a short name such as MK as your Virtual Directory name.
You cannot keep the web.config only in the sub-directory. You need to have a web.config in the root directory. If at all you want to have a web.config in the sub-directory, then the only settings you can specify are authorization, appsettings etc.,
Unless you configure the sub-directory also as an application in the IIS Virtual directory settings, you cannot have any other settings such as authentication, session-state etc., in the web.config that you have in the sub-directory.
Hope that makes it clear.
Thanks.
Awesome thread gents/ladies! I pulled this up in Google since I'm a new ASP 2.0 User. This remedied my issue. Thank you.
I am also getting same error when i am using the asp.net user controls in sahrepoint webparts.
"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"
But my virtual directory is configured. and i am able to run the asp.net solution which consists of user controls with out any errors.
I am getting the error only when i am using these usercontrols in creating webparts
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
Even i was also facing this problem... and the root of the problem was that i had one duplicate web.config file in a subfolder.... As i removed that file error has been gone... Many Thanks....
ranganh
Star
12085 Points
2435 Posts
Microsoft
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond appli...
Dec 10, 2004 06:23 AM|LINK
Harish
http://geekswithblogs.net/ranganh
sanju
Member
5 Points
1 Post
Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...
Sep 23, 2005 07:37 AM|LINK
ranganh
Star
12085 Points
2435 Posts
Microsoft
Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...
Sep 26, 2005 04:53 AM|LINK
You cannot keep the web.config only in the sub-directory. You need to have a web.config in the root directory. If at all you want to have a web.config in the sub-directory, then the only settings you can specify are authorization, appsettings etc.,
Unless you configure the sub-directory also as an application in the IIS Virtual directory settings, you cannot have any other settings such as authentication, session-state etc., in the web.config that you have in the sub-directory.
Hope that makes it clear.
Thanks.
Harish
http://geekswithblogs.net/ranganh
andrewk
Member
5 Points
1 Post
Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...
Oct 29, 2005 08:26 PM|LINK
I had the same error and solved it by doing the following:
Give your virtual directory an Application Name that does not have dots (.) in the name. To make sure you are not having naming issues, give a short name such as MK as your Virtual Directory name.
After doing this, this problem was solved.
Andrew
CuTePiNkBuNn...
Member
10 Points
2 Posts
Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...
Dec 05, 2005 04:45 PM|LINK
Awesome thread gents/ladies! I pulled this up in Google since I'm a new ASP 2.0 User. This remedied my issue. Thank you.
Jon
nizdon
Member
117 Points
24 Posts
Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...
Jan 18, 2006 07:31 AM|LINK
I am also getting same error when i am using the asp.net user controls in sahrepoint webparts.
"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"
But my virtual directory is configured. and i am able to run the asp.net solution which consists of user controls with out any errors.
I am getting the error only when i am using these usercontrols in creating webparts
Help me
Nizdon
Mickster
Member
15 Points
3 Posts
Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...
Apr 13, 2006 04:59 PM|LINK
Hi
That worked great thanks.[:D]
mickster
maryam_ms198...
Member
18 Points
69 Posts
Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...
Jun 02, 2007 01:04 PM|LINK
needo001
Member
25 Points
26 Posts
Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...
Sep 06, 2007 12:44 PM|LINK
Thnaks buddy it helped
shantanushuk...
Member
475 Points
152 Posts
Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...
Oct 08, 2007 10:12 AM|LINK
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
Even i was also facing this problem... and the root of the problem was that i had one duplicate web.config file in a subfolder.... As i removed that file error has been gone... Many Thanks....
asp.NET 2.0
http://www.linkedin.com/in/shantanushukla