ASP.NET What causes: It is an error to use a section registered as allowDefinition=’MachineToApplication’ beyond application…?

I have an ASP.NET web site. I keep getting the error below in VS 2008. The site works fine from a browser. I have made every folder using IIS manager an ASP.NET app. Why does it keep complaining? The site’s folder is below a parent folder.
I am not familiar with web site apps instead of web application app. Where are the options to use IIS or the internal web server like WAP has?

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

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

I dealed a lot with this error when having more than one web.config in the same virtual web directory / website. It may happen if you make a temporary backup of your website for example. Could you verify it?

Method 2

This error can occur when you are you redefining stuff in the web.config of your virtual directory that you cannot override. Such as authentication or sessionstate. Try deleting all web.configs in your virtual directories to see if that solves the problem.

Method 3

You likely have a virtual directory set up as a real site, having a bin directory, aspnet_client and web.config.

Either remove those and run it as a relative path, localhostsubdirdefault.aspx, or create a new website in IIS to point directly at it.

Method 4

My workaround was to move each folder into its own folder under wwwroot.

Method 5

I resolved this issue by doing the following,

  1. Select your project in Visual Studio and click ‘Show all files’ under Solution Explorer.
  2. Delete the ‘obj’ folder and recompile.

enter image description here


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x