Generate XML Documentation using MSBuild /property<p>I want to generate XML documentation for a project without turning on this option permanently in the project. Is there a way to generate the XML documentation file for a project by passing arguments to MSBuild? </p> <p> </p> <p>For example: </p> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">Code Snippet</span></div> <p><font size=2>msbuild XMLComments.csproj /t:Rebuild /p:nowarn=1591 /p:doc=XMLComments.xml</font></p></div></div> <p> </p> <p>yields the following results:</p> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%"><font size=2>Code Snippet</font></span></div><font size=2>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1591,1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug+ /debug:full /optimize- /out:obj\Debug\XMLComments.exe /resource:obj\Debug\XMLComments.Properties.Resources.resources /target:winexe Form1.cs Form1.Designer.cs Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs</font></div></div> <p><font size=2> </font></p> <p> </p> <p>I expected the /p<img height=19 alt="Big Smile" src="http://forums.microsoft.com/MSDN/emoticons/emotion-2.gif" width=19>oc parameter to override the settings in the csproj file and generate the XML output. The /p:nowarn parameter worked as I expected. I do not see /doc:XMLComments.xml on the csc command line. MSBuild appears to ignore the /p<img height=19 alt="Big Smile" src="http://forums.microsoft.com/MSDN/emoticons/emotion-2.gif" width=19>oc parameter.</p> <p> </p> <p>Is there a work-around for this?</p> <p> </p>© 2009 Microsoft Corporation. All rights reserved.Thu, 19 Jun 2008 00:15:52 Z65af1425-8aef-4ce1-bf5d-6296506b34bchttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/65af1425-8aef-4ce1-bf5d-6296506b34bc#65af1425-8aef-4ce1-bf5d-6296506b34bchttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/65af1425-8aef-4ce1-bf5d-6296506b34bc#65af1425-8aef-4ce1-bf5d-6296506b34bcSmazhttp://social.msdn.microsoft.com/Profile/en-US/?user=SmazGenerate XML Documentation using MSBuild /property<p>I want to generate XML documentation for a project without turning on this option permanently in the project. Is there a way to generate the XML documentation file for a project by passing arguments to MSBuild? </p> <p> </p> <p>For example: </p> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">Code Snippet</span></div> <p><font size=2>msbuild XMLComments.csproj /t:Rebuild /p:nowarn=1591 /p:doc=XMLComments.xml</font></p></div></div> <p> </p> <p>yields the following results:</p> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%"><font size=2>Code Snippet</font></span></div><font size=2>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1591,1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug+ /debug:full /optimize- /out:obj\Debug\XMLComments.exe /resource:obj\Debug\XMLComments.Properties.Resources.resources /target:winexe Form1.cs Form1.Designer.cs Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs</font></div></div> <p><font size=2> </font></p> <p> </p> <p>I expected the /p<img height=19 alt="Big Smile" src="http://forums.microsoft.com/MSDN/emoticons/emotion-2.gif" width=19>oc parameter to override the settings in the csproj file and generate the XML output. The /p:nowarn parameter worked as I expected. I do not see /doc:XMLComments.xml on the csc command line. MSBuild appears to ignore the /p<img height=19 alt="Big Smile" src="http://forums.microsoft.com/MSDN/emoticons/emotion-2.gif" width=19>oc parameter.</p> <p> </p> <p>Is there a work-around for this?</p> <p> </p>Tue, 24 Apr 2007 16:21:58 Z2007-04-25T17:15:04Zhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/65af1425-8aef-4ce1-bf5d-6296506b34bc#69fae342-b903-4c31-95cd-3fa84196691fhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/65af1425-8aef-4ce1-bf5d-6296506b34bc#69fae342-b903-4c31-95cd-3fa84196691fSimon Dahlbackahttp://social.msdn.microsoft.com/Profile/en-US/?user=Simon%20DahlbackaGenerate XML Documentation using MSBuild /propertyIt should work if you pass in /p<img height=19 alt="Big Smile" src="http://forums.microsoft.com/MSDN/emoticons/emotion-2.gif" width=19>ocumentationFile=foo.xmlTue, 24 Apr 2007 18:58:08 Z2007-04-25T17:15:04Zhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/65af1425-8aef-4ce1-bf5d-6296506b34bc#7c7f26e1-1151-401d-ba35-e4111412bf73http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/65af1425-8aef-4ce1-bf5d-6296506b34bc#7c7f26e1-1151-401d-ba35-e4111412bf73Smazhttp://social.msdn.microsoft.com/Profile/en-US/?user=SmazGenerate XML Documentation using MSBuild /propertyThat does the trick. Thank you!Tue, 24 Apr 2007 21:28:22 Z2007-04-24T21:28:22Z