.NET Framework Bookmark and Share   
 index > MSBuild > switch to create xml documentation for csharp project
 

switch to create xml documentation for csharp project

I am building my csharp project using MSBuild.exe. Can someone tell me what is the switch that I can provide to the MSBuild project to generate XML documentation for the code?

Thanks in advance
Bravo2007
Hello,

After investigated it, I found the property "DocumentationFile" is responsible for the XML documentation file:
1. Check the 'XML documentation file' checkbox in Project Properties| Build in Visual Studio and save the settings.
2. Compare the new saved project file with the original one, you will find a line of code is added into PropertyGroup: <DocumentationFile>bin\Debug\VSPackage1.XML</DocumentationFile>

So we could run MSBuild to specify this property like:
C:\Windows\system32>msbuild "xxx.csproj" /p:DocumentationFile="bin\Debug\xxx.xml"

I have got many undocumented properties by this way, or through EnvDTE.Project.Properties. :)

Sincerely,
Wesley
Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
  • Marked As Answer byBravo2007 Monday, August 24, 2009 5:03 PM
  •  
Wesley Yao
Hello,

After investigated it, I found the property "DocumentationFile" is responsible for the XML documentation file:
1. Check the 'XML documentation file' checkbox in Project Properties| Build in Visual Studio and save the settings.
2. Compare the new saved project file with the original one, you will find a line of code is added into PropertyGroup: <DocumentationFile>bin\Debug\VSPackage1.XML</DocumentationFile>

So we could run MSBuild to specify this property like:
C:\Windows\system32>msbuild "xxx.csproj" /p:DocumentationFile="bin\Debug\xxx.xml"

I have got many undocumented properties by this way, or through EnvDTE.Project.Properties. :)

Sincerely,
Wesley
Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
  • Marked As Answer byBravo2007 Monday, August 24, 2009 5:03 PM
  •  
Wesley Yao
I posted a question related to the same issue http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/14e4e7bc-9bb8-4369-8190-87e014aa63f4 but didn't receive any replies yet.

Basically, this DocumentationFile works fine if you're building a single csharp project. But if you tried building a batch of of csharp projects then setting DocumentationFile property turns into an exercise in frustration. I don't believe the document generation functionality is implemented correctly in MSBuild.
Vladimir Nestoyanov
Hi..

WHy not generate a configuration (f.ex Docu) via the projects configuratio manager, this configuration generates the xml for all projects. then you can call the msbuild with the switch
/p:Configuration=Docu

regards
SharePointMaster

You can use google to search for other answers

Custom Search

More Threads

• Target .NET 1.1 using Visual Studio 2005
• Can I create conditional Project Dependencies somehow?
• why did the assembly version number always ignore the very first ZEROs, e.g., 001?
• Getting the Error "Object reference not set to any instance of object" when i am viewing the code from the designer in C# vs 2008
• Before all builds and after all builds..
• error MSB6003: The specified task executable could not be run...
• RecursiveDir in ItemGroup
• ConvertToAbsolutePath error?
• When do you need the Windows SDK to build?
• <itemgroup> is not working???????????