views:

22

answers:

1

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:

"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."

It's the child web.config 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.

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?

+1  A: 

Found the answer here Specifically, if you have nested web applications, you need to enable the "Use IIS metabase path for source input" option in the Compliation section of the Web Deployment Project Properties. That will cause only the root application to be built. The default is for the Web Deployment Project to build all applications including children.

Brett Bim