Web Deployment Project error "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level."
Ok, Here's the skinny
I have a smallish Visual Studio 2008 web application that I'm attempting to set up a Web Deployment Project with.
If I skip attempting to build the Deployment Project, the application builds successfully.
If I build the Deployment Project, I get the following error:
Error 208: 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. C:\Projects\app\web\bin\web.config
After stumbling around the internet for a few hours with the only explanation being: "OMG! You CLEARLY have two web.config files in your project and one of them is nested in a subfolder, just convert that folder to an application in IIS - problem solved! DUH!"
I digged around my project to ensure I didn't have a stray web.config file - and I don't...
EXCEPT FOR THE ONE THAT KEEPS SHOWING UP IN MY BIN FOLDER WHEN I BUILD THE DAMN DEPLOYMENT PROJECT!!!
So at this point actually do have two web configs. One of them is the legitimate web.config in the root of the application folder, and one is in the bin subfolder.
...This subsequently makes the compiler choke.
Is there a msbuild BeforeBuild step to handle this scenario? Is the Web Deployment Project concept a piece of junk?
Usually that means you have authentication set on the lower level web.config. Try removing that.