Click here to Skip to main content
15,896,359 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Dear Friends,

I have a website in which there are two web.config files, one at root folder and one at sub-folder.
When I compile the project it gives an error like this:-

"Error   92  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.  D:\EHRFTP\Dilip\Medical\Website\web.config
"


Then I searched the web and found that:-"The root cause is some elements in web.config don't allow sub-directory level. All of those elements have an attribute: allowDefinition="MachineToApplication". It means we can only define those elements in machine level and root application level." (ref:-http://forums.asp.net/t/1184374.aspx[^])

and to solve the above issue, please remove the elements (in the sub-directory web.config) which can result in this problem. For example: membership, roleManager, sessionState, authentication, and so on. They can automatically inherits from the root web.config.

I did the same but then I got another type of errors. I also found another solution as:-
XML
Of course we can put web.config in sub folder. However, the authentication section has an attribute: allowDefinition="MachineToApplication". It means we can only define the authentication section in machine level and root application level.
So the solution is to remove this line: <authentication mode="Windows" /> in forms\news\web.config. It can be defined in forms web.config.\


But still no rescue. Can anyone give a concrete answer to solve the particular issue?

Thanks

Varun Sareen


UPDATE from OP:
Well I found the solution myself:- actually there was only one web.config file that was being used in the sub-folder only and I have to just open the solution file which was present outside the sub-folder that did all the work and application cum website ran successfully.
Posted
Updated 20-Oct-10 21:54pm
v3
Comments
Dalek Dave 21-Oct-10 3:54am    
Edited for Grammar.

 
Share this answer
 
Comments
Varun Sareen 21-Oct-10 2:15am    
Dear Suthish,

You actually have given me the same blog link that i have in my question where i found the answer. Well thanks for the concern.
Suthish Nair 21-Oct-10 2:29am    
the same link also posted with answer.....
Varun Sareen 21-Oct-10 2:41am    
That answer didn't help me out dear. Well i found the solution myself:- actually there was only one web.config file that was being used in the sub-folder only and i have to just open the solution file which was present outside the sub-folder that did all the work and application cum website ran successfully.

Thanks for the concern.
Well I found the solution myself:- actually there was only one web.config file that was being used in the sub-folder only and I have to just open the solution file which was present outside the sub-folder that did all the work and application cum website ran successfully.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900