Posted by matt as ASP.NET, Visual Studio
I was trying to deploy my Project using Visual Studio 2008 a while ago, when I encountered this Error:
“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.”
And I had no idea why it was happening. I was not even trying to access my project in a browser (I was just trying to deploy!). I wasted almost an hour trying to figure it out before I luckily stumbled to Rob Gruen’s blog. Though his case was different (I did not upgrade), I hurriedly followed his suggestion. I search for web.config file in my project’s folder and to my surprise, there were two of them. Suddenly, I remember that I was testing something and added a test-website inside my project which contains a web.config file. I just deleted the whole test-website and, boom! the deployment went smoothly. So, if you encounter this error, just remember that you cannot use multiple web.config in one application.
2 Responses
ikaruga
May 14th, 2009 at 7:44 am
1I wish VS would rather say, “Hey, you are allowed to have only one web.config!” rather than
“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.”
This error message is miles away from the actual problem. You’d really have to decipher.
matt
May 14th, 2009 at 7:50 am
2hehe
I agree, but I don’t think VS was aware that two config files existed. So, instead it just throw the closest error it knows that could possibly cause this problem.
RSS feed for comments on this post · TrackBack URI
Leave a reply
Categories
Random Posts
.Net asp .net tutorial asp .net tutorial c# sample code CSS sample script database guide java sample code javascript sample code mssql sample script string reverse in C# t-sql telerik sample code user-defined function vb .net sample code visual studio tutorial
WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.