Friday, May 31, 2013

Configuration Error:It is an error to use a section registered as allow definition ="MachineToApplication" beyond application level

Leave a Comment
It is an error to use a section registered as allow definition ="MachineToApplication" beyond application level. This error can be caused by a virtual Directory not being configured as an application in IIS as shown in the picture below:


configuration error



Cause of Error: Generally this error is caused if your website has more than one web.config files or you are trying to install a cms or blog inside a folder in your web application. 




If you have added second  web.config by mistake then remove that and problem will be solved.



If you are trying to install cms inside a folder in your application then follow the steps which I am going to explain next in this  article.




Note: If you get this error online then ask your hosting company to set the folder as virtual directory in which you are trying to install CMS or asp.net blog, your problem will be solved automatically.


But if you working on development server then first install IIS on Local Machine  and then check the post How to deploy website in IIS on localhost .

Steps to Create Virtual Directory In IIS:

As I was trying to install BlogEngine.net in my web application inside the blog folder and got the error . Steps which I followed to fix the error are as follows:

Step 1: Right click on the folder in IIS which is to be set as virtual directory and then click on convert to Application as shown in figure below:


Convert to Application in IIS

Step 2: In Add Application window just click on Ok  button as shown below:


virtual directory in iis


Step 3: Now Right click on folder which you have set as an Application and then browse the site in browser:


Browse site in browser in IIS

Final Result is shown below in which you can see that now I can browse the blog folder inside which I have installed blogengine.net blog without getting the error a section registered as allow definition ="MachineToApplication" beyond application level.This error can be caused by a virtual Directory not being configured as an application in IIS.


Blog Engine.Net Installed sucesssfully


Conclusion: The above method is also applicable if you are trying to install any other .net CMS or Blogging software inside a folder in your application. Hope this fix sorted out your problem. If not then comment with your issue so I can help you to fix the issue.

0 comments:

Post a Comment