title: MVCBuildViews not working correctly
body: <p>So I edited my csproj file on an MVC 3 RTM application to set the following property:</p>
  
  <pre><code>&lt;MvcBuildViews&gt;true&lt;/MvcBuildViews&gt;
  </code></pre>
  
  <p>This should cause my views to be complied during build and force a build error if my view is broken. This is the only change I made, however, when I try to build the application, I get the following error:</p>
  
  <blockquote>
    <p>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>The project compiles and runs successfully if I change back to  false,</p>
  
  <p>The following are the build tasks configured in the csproj file (these were never manually edited, they were added by Visual Studio 2010)</p>
  
  <pre><code>&lt;Target Name="BeforeBuild"&gt;
  &lt;/Target&gt;
  &lt;Target Name="AfterBuild"&gt;
  &lt;/Target&gt; --&gt;
  &lt;Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'"&gt;
    &lt;AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" /&gt;
  &lt;/Target&gt;
  </code></pre>
  
  <p>Am I missing something here? How do I get MVC 3 / Visual Studio 2010 configured correctly to validate my views at build time?</p>