Note that there are some explanatory texts on larger screens.

plurals
  1. POMSBuild: Generate XML documentation for main project but not dependency projects
    text
    copied!<p>I have a .sln file with several projects in it. To keep this simple, let's call them...</p> <ul> <li>ProjectA</li> <li>ProjectB</li> <li>ProjectC</li> </ul> <p>...where A is the main project which references B and C. My goal is to update my build script to generate an XML "Intellisense" documentation file for ProjectA, without giving build warnings about missing documentation from B and C.</p> <h2>Current Build Script</h2> <p>I have an MSBuild script which includes the following in the build step:</p> <pre><code>&lt;PropertyGroup&gt; &lt;CustomOutputPath&gt;C:\build\output\&lt;/CustomOutputPath&gt; &lt;/PropertyGroup&gt; &lt;ItemGroup&gt; &lt;Projects Include="ProjectA\ProjectA.csproj"&gt; &lt;Properties&gt;OutputPath=$(CustomOutputPath)&lt;/Properties&gt; &lt;/Projects&gt; &lt;/ItemGroup&gt; &lt;MSBuild Projects="@(Projects)" /&gt; </code></pre> <p>(There are actually multiple Projects listed in the ItemGroup, but again, let's keep this simple.)</p> <p>When I run the build script, it's smart enough to compile B, C, and A for me, even though I've only specified A. All output appears in the "CustomOutputPath" location.</p> <h2>The closest I've gotten...</h2> <p>If I add a 'DocumentationFile' property to my Project entry...</p> <pre><code>&lt;ItemGroup&gt; &lt;Projects Include="ProjectA\ProjectA.csproj"&gt; &lt;Properties&gt;OutputPath=$(CustomOutputPath);DocumentationFile=ProjectA.xml&lt;/Properties&gt; &lt;/Projects&gt; &lt;/ItemGroup&gt; </code></pre> <p>...then 'ProjectA.xml' appears in "CustomOutputPath". However, I also get files named 'ProjectA.xml' in the project folder for all three projects:</p> <ul> <li>ProjectA/ProjectA.xml</li> <li>ProjectB/ProjectA.xml</li> <li>ProjectC/ProjectA.xml</li> </ul> <p>These files contain the "Intellisense" documentation for their respective projects, even though they're all named "ProjectA.xml".</p> <p>This creates undesired and misleadingly-named files in the project folders, and (more importantly) generates build warnings for the missing documentation comments in B and C. I don't want to add documentation comments to those projects, so I'd prefer to find a way to have MSBuild generate the documentation only for ProjectA.</p> <p>Can anyone provide any insight, or an alternative solution?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload