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:-
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.