title: IIS metabase path for aspnet_compiler in IIS7
body: <p>I am trying to use aspnet_compiler via the command line to build and publish a web application that is running on the IIS7 Default Web Site. I am struggling with finding the correct syntax of the -m argument for specifying the IIS metabase path.</p>
  
  <p>All the documentation refers to IIS6 metabase paths, which are of the format "LM/W3SVC/1/Root". I came across <a href="http://mvolo.com/blogs/serverside/archive/2007/07/21/Anatomy-of-an-IIS7-configuration-path.aspx" rel="nofollow">this information</a>, which indicates the IIS7 metabase path should look like "MACHINE/WEBROOT/APPHOST/Default Web Site."</p>
  
  <p>The actual command then looks like this:</p>
  
  <pre><code>aspnet_compiler -nologo -m "MACHINE/WEBROOT/APPHOST/Default Web Site/" \\productionwebserver\inetpub\websitefolder\
  </code></pre>
  
  <p>This, however, results in the following error: <em>error 1002: 'MACHINE/WEBROOT/APPHOST/Default Web Site/' is not a well formed IIS metabase path.</em></p>
  
  <p>My default website is called "Default Web Site". I have also explored using the syntax of specifying the virtual path and physical path instead of the metabase path, for example:</p>
  
  <pre><code>aspnet_compiler -nologo -v / -p ".."
  </code></pre>
  
  <p>(this command file exists in a sub-folder of the website project folder)</p>
  
  <p>This results in the following error: <em>error ASPCONFIG: 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.</em></p>
  
  <p>The website builds fine from within VS2010.</p>