开发者

How do I get MSBuild Task to generate XML Documents when building a solution?

I have a solution with lots of projects. Each project is configured to generate the XML documentation file when building in Debug-Mode (which is default). That works when I build in Visual Studio 2008. In my build script on my integration server I advise MSBuild to build the whole solution, but it won't generate the documentation files. What can I do?

I already tried to explicitly give the Debug-Condition to the build process, but it makes no difference.

<Target Name="BuilSolution">
     <MSBuild Projects="C:\Path\To\MySolution.sln" targets="Build" Properties="SolutionConfigurationPlatforms='Debug|Any CPU'"/>
</Target>    

There seem to be some ideas to sol开发者_Python百科ve this problem when building single projects, but I can't afford to do this, so I need a hint for doing it this way.

Thanks in advance!


In VS 2010, you can either do this in C# project properties, or you can define a DocumentationFile property in your .csproj file. For example:

<PropertyGroup>
  ...
  <DocumentationFile>$(OutputPath)MyAssembly.xml</DocumentationFile>
</PropertyGroup>

The MSBuild code in $(MSBuildToolsPath)\Microsoft.CSharp.targets will condition on that property being defined - if it is, your XML Comments file will be created.


I do this all the time with my CI server. Just pass properties as follows:

Properties="Configuration=Debug;Platform=Any CPU"


Project properties are different for each configuration. In your project properties you have enabled XML document only for the debug config. Switch to the release config and enable it for that one too.


Wild guess - the only thing I can see that might help is to set the GenerateDocumentation parameter in your build script.

To quote from a bit of MSDN (that references .NET 4, so I'm not certain that this is applicable): GenerateDocumentation A boolean parameter that indicates whether documentation is generated by the build. If true, the build generates documentation information and puts it in an .xml file together with the name of the executable file or library that the build task created.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜