Microsoft, Technical, Visual Studio

Error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level

I have been giving the Visual Studio 2008 Beta 2 a whirl and the first thing I wanted to do was to open my existing project targeted for .Net Framework 2.0 in Orcas beta. The good thing about the conversion wizard is unlike the the 2005 conversion wizard which converts all projects to use the new framework, this one actually prompts and asks if you want to continue with the existing framework or upgrade to the .Net framework 3.5. Sweet, as I just wanted to test the IDE and not the framework. I am more interested in the IDE capabilities like the JavaScript debugger and Split mode design and code view (just like in Adobe Dreamweaver šŸ™‚ amongst others.

So, I fired up the IDE and opened my existing solution which contained about 6 projects in them including a Website and the rest as class libraries. It opened up the conversion wizard and asked me if I would like to create a backup. I said yes and proceeded. That is where my trouble started. Once the conversion was done I tried building the solution and the compiler threw the following error:

Error    46    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. 

I was using the development server and no IIS. And no clue about how to configure a website in the the development server as an application. After scavenging through tons of Google Results I came across a post that mentioned the following:

I don’t understand why, but when I have a web.config file defined within the individual application directories, I receive the error described the the person initiating this thread. Removing the web.config file fixed the problem for me. With that said, it is also important to define the applications virtual directory as a web app, the the last forum post explained.

Hmmm.. having read that the backup I created on conversion came across my mind. It was inside the website folder like this:


The backup folder also had a copy of the Web.Config file inside it. That was it. I moved the backup folder elsewhere and tried rebuilding the solution and voila,

========== Build: 6 succeeded or up-to-date, 0 failed, 0 skipped ==========

12 thoughts on “Error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s