title: Web Deployment Project With Nested Applications
body: <p>I have a web application that I'm trying to create a Web Deployment Project for in Visual Studio 2008.  My application also has a child web application.  Both are web applications in IIS. I have added the Web Deployment Project so that I can automate the build process for this application. When I try to build the Web Deployment Project, I get the following error:</p>
  
  <blockquote>
    <p>Error 639 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.</p>
  </blockquote>
  
  <p>It's the child <code>web.config</code> that the error is referring to.  I've tried to find a solution on the web and while this seems to be a common error, neither of the two suggested solutions seems to fix my problem. The first solution is to make sure the application is an application in IIS which both of mine are. The second is to make sure there are no child web.configs anywhere in the solution. I have a child config but it is part of the child web application and cannot be eliminated.</p>
  
  <p>Is there a way to get the Web Deployment Project to build with an application structure like this?  If not, is there a way to automate building .Net web applications using MSBuild without a Web Deployment Project?</p>