title: Visual Studio Rebuilds projects when switching from debug to release and vice-versa when option XML documentation is selected
body: <p>I've a very similar problem than described in the following question
  <a href="https://stackoverflow.com/q/32956136/7556646">Visual Studio C# projects force a rebuild when switching from debug to release and vice-versa</a>.</p>
  
  <p>I've C# two projects and one has project reference to the other. 
  If I build (F6) in Debug and than I build (F6) in Release. If I now switch back to Debug and build (F6) it should be up to date. </p>
  
  <p>That's is actually the case. So I can see that in the bin/Debug folder the file date and the assembly version are not changing.</p>
  
  <p>But if I switch on the XML documentation file for the project which has project reference to the other under Project Properties / Build / Output for both configurations (Debug and Release) then the projects gets rebuild every time I switch from Debug to Release or vice-versa.</p>
  
  <p>To recreate the issue:</p>
  
  <ol>
  <li>Click <code>File</code> / <code>New Project...</code></li>
  <li>Create a new <code>Visual C#</code> --> <code>Console Application</code>.  Leave the generated code as-is.</li>
  <li>Right-click on the new solution in the solution explorer and select <code>Add</code> -> <code>New Project...</code></li>
  <li>Choose <code>Visual C#</code> --> <code>Class Library</code>.  Leave the generated code as-is.</li>
  <li>Right-click on the <code>ConsoleApplication1</code> in the solution explorer and select <code>Add Reference...</code></li>
  <li>Check the box next to <code>ClassLibrary1</code> in <code>Solution</code> -> <code>Projects</code> and hit <code>OK</code>.</li>
  <li>Switch on the <code>XML documentation file</code> for the <code>ConsoleApplication1</code> under Project <code>Properties</code> / <code>Build</code> / <code>Output</code> for both configurations (<code>Debug</code> and <code>Release</code>)</li>
  <li>Build the project in <code>Debug</code> configuration.  It builds, as expected.</li>
  <li>Switch to <code>Release</code> configuration and build again.  It builds, as expected.</li>
  <li>Switch back to <code>Debug</code> and build again.  It <em>builds</em>, and it shouldn't.  It's already been built, right?  All we did was change the target configuration selection.</li>
  </ol>
  
  <p>I'm getting the following build output:</p>
  
  <pre><code>1&gt;------ Build started: Project: ConsoleApplication1, Configuration: Debug Any CPU ------
  1&gt;Build started 07.09.2018 13:46:43.
  1&gt;GenerateTargetFrameworkMonikerAttribute:
  1&gt;Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
  1&gt;CoreCompile:
  1&gt;  C:\Program Files (x86)\MSBuild\12.0\bin\Csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /doc:bin\Debug\ConsoleApplication1.XML /define:DEBUG;TRACE /errorendlocation /preferreduilang:en-US /highentropyva+ /reference:H:\CSharp\TestRebuild\ClassLibrary1\bin\Debug\ClassLibrary1.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\ConsoleApplication1.exe /subsystemversion:6.00 /target:exe /utf8output Program.cs Properties\AssemblyInfo.cs "C:\Users\WO\AppData\Local\Temp\.NETFramework,Version=v4.5.AssemblyAttributes.cs" obj\Debug\\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs obj\Debug\\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs obj\Debug\\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
  1&gt;_CopyAppConfigFile:
  1&gt;Skipping target "_CopyAppConfigFile" because all output files are up-to-date with respect to the input files.
  1&gt;CopyFilesToOutputDirectory:
  1&gt;  Copying file from "obj\Debug\ConsoleApplication1.exe" to "bin\Debug\ConsoleApplication1.exe".
  1&gt;  ConsoleApplication1 -&gt; H:\CSharp\TestRebuild\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe
  1&gt;
  1&gt;Build succeeded.
  1&gt;
  1&gt;Time Elapsed 00:00:00.41
  ========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
  </code></pre>
  
  <p>If <code>XML documentation file</code> is switched off I'm getting the following build output (it skips the CoreCompile as it should):</p>
  
  <pre><code>1&gt;------ Build started: Project: ConsoleApplication1, Configuration: Debug Any CPU ------
  1&gt;Build started 07.09.2018 13:50:17.
  1&gt;GenerateTargetFrameworkMonikerAttribute:
  1&gt;Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
  1&gt;CoreCompile:
  1&gt;Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
  1&gt;_CopyAppConfigFile:
  1&gt;Skipping target "_CopyAppConfigFile" because all output files are up-to-date with respect to the input files.
  1&gt;CopyFilesToOutputDirectory:
  1&gt;  ConsoleApplication1 -&gt; H:\CSharp\TestRebuild\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe
  1&gt;
  1&gt;Build succeeded.
  1&gt;
  1&gt;Time Elapsed 00:00:00.07
  ========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
  </code></pre>
  
  <p>Is this a bug?  Is there a workaround?</p>