我正在尝试为解决方案中的所有项目创建XML文档,即使未在项目属性中选中该选项(这是关键点).
我正在使用TFS 2010 SP1并在我的构建定义的"MSBuild Arguments"字段中尝试使用"/ p:TreatWarningsAsErrors = true/p:GenerateDocumentation = true".它不会产生任何结果.
我也尝试使用/p:DocumentationFile=foo.xml,它确实可以工作但是我假设文件被最后编译的项目覆盖了,所以我尝试使用变量但是没有运气,我尝试了
/p:DocumentationFile=$(Project).xml,
/p:DocumentationFile=$(localProject).xml
/p:DocumentationFile=$(localBuildProjectItem).xml
Run Code Online (Sandbox Code Playgroud)
有没有办法为MSBUILD中的所有项目创建XML文档,即使项目中未选中该选项?
PS:是的,我已经看到了另一个与此类似的线程,但我不想修改项目,这就是用MSBUILD做的全部内容.
谢谢你的时间
打开您的流程模板(即$/yourproject/BuildProcessTemplates/DefaultTemplate.xaml
:)
向下滚动找到该Compile the Project
活动。
DocumentationFile
、 type= String
、scope=的新变量Compile the Project
将其默认值设置为:
String.Format("{0}.XML", System.IO.Path.GetFileNameWithoutExtension(serverBuildProjectItem))
保存更改并向下滚动到Run MSBuild for Project
活动。
在 中CommandLineArguments
,设置以下值:
String.Format("/p:SkipInvalidConfigurations=true {0};DocumentationFile={1}", MSBuildArguments, DocumentationFile)
签入更改并构建。即使项目没有设置,这也应该生成文档。