title: Web.config transformation: Unrecognized attribute 'xmlns:xdt'. Note that attribute names are case-sensitive
body: <p>I'm getting this strange intermitent bug in a MVC 3.0 project
  When I build the project sometimes I get the following error message:</p>
  
  <blockquote>
    <p>Unrecognized attribute 'xmlns:xdt'. Note that attribute names are
    case-sensitive.</p>
  </blockquote>
  
  <p>This is referring to the standard web.config tranformation file (Web.Release.config copied below)
  There are no other errors or warnings.  This is happening in debug mode and release.
  Sometimes it clears if I clean the solution</p>
  
  <p><strong>BEGIN UPDATE</strong></p>
  
  <p>Found the issue.  In the MVC Project file (MyProject.csproj) I had set build views to true</p>
  
  <pre><code>&lt;MvcBuildViews&gt;true&lt;/MvcBuildViews&gt;
  </code></pre>
  
  <p>Once put back to <strong>false</strong> the above error goes away.  I'd like to have the view build as it stops alot of stupid view code errors etc and is a performance enhancement (pages are precompiled instead of jit)</p>
  
  <p>Anyone know what this is causing the error?  is this a bug?</p>
  
  <p><strong>END UPDATE</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  
  &lt;!-- For more information on using Web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 --&gt;
  
  &lt;configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"&gt;
    &lt;!--
      In the example below, the "SetAttributes" transform will change the value of 
      "connectionString" to use "ReleaseSQLServer" only when the "Match" locator 
      finds an atrribute "name" that has a value of "MyDB".
  
      &lt;connectionStrings&gt;
        &lt;add name="MyDB" 
          connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" 
          xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/&gt;
      &lt;/connectionStrings&gt;
    --&gt;
    &lt;system.web&gt;
      &lt;compilation xdt:Transform="RemoveAttributes(debug)" /&gt;
      &lt;!--
        In the example below, the "Replace" transform will replace the entire 
        &lt;customErrors&gt; section of your Web.config file.
        Note that because there is only one customErrors section under the 
        &lt;system.web&gt; node, there is no need to use the "xdt:Locator" attribute.
  
        &lt;customErrors defaultRedirect="GenericError.htm"
          mode="RemoteOnly" xdt:Transform="Replace"&gt;
          &lt;error statusCode="500" redirect="InternalError.htm"/&gt;
        &lt;/customErrors&gt;
      --&gt;
    &lt;/system.web&gt;
  &lt;/configuration&gt;
  </code></pre>