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?
For example:
Code Snippet
msbuild XMLComments.csproj /t:Rebuild /p:nowarn=1591 /p:doc=XMLComments.xml
yields the following results:
Code Snippet
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
I expected the /p
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
oc parameter.
Is there a work-around for this?