.NET Framework Developer Center > .NET Development Forums > MSBuild > Generate XML Documentation using MSBuild /property
Ask a questionAsk a question
 

AnswerGenerate XML Documentation using MSBuild /property

  • Tuesday, April 24, 2007 4:21 PMSmaz Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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 /pBig Smileoc 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 /pBig Smileoc parameter.

     

    Is there a work-around for this?

     

Answers

All Replies