[英]Can DocumentationFile and GenerateDocumentationFile be used together in .Net project file?
I'm writing a small analyzer for C# projects that checks if the XML documentation generation is present and set up correctly.我正在为 C# 项目编写一个小型分析器,用于检查 XML 文档生成是否存在并正确设置。 There are two options for to specify XML documentation:
有两个选项可以指定 XML 文档:
DocumentationFile
optionDocumentationFile
选项GenerateDocumentationFile
flag.GenerateDocumentationFile
标志。 If the flag is set to true MSBuild should generate a XML documentation file with the project's name in the project's output directory. Can both of these options be specified explicitly in the project file?可以在项目文件中明确指定这两个选项吗? Will the values from these options be combined or one of the options will be ignored?
这些选项的值是否会被组合,或者其中一个选项将被忽略?
They both don't need to be set.它们都不需要设置。 If
DocumentationFile
is not empty, then GenerateDocumentationFile
will set to true
in an MSBuild target.如果
DocumentationFile
不为空,则GenerateDocumentationFile
将在 MSBuild 目标中设置为true
。
If you set GenerateDocumentationFile
to true
, then a default value for DocumentationFile
will be set based on the project file name.如果将
GenerateDocumentationFile
设置为true
,则会根据项目文件名设置DocumentationFile
的默认值。
Relevant MSBuild targets相关 MSBuild 目标
<!-- Handle XML documentation file settings -->
<PropertyGroup Condition="'$(GenerateDocumentationFile)' == ''">
<GenerateDocumentationFile Condition="'$(DocumentationFile)' == ''">false</GenerateDocumentationFile>
<GenerateDocumentationFile Condition="'$(DocumentationFile)' != ''">true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(GenerateDocumentationFile)' == 'true' and '$(DocumentationFile)' == ''">
<DocumentationFile Condition="'$(MSBuildProjectExtension)' == '.vbproj'">$(AssemblyName).xml</DocumentationFile>
<DocumentationFile Condition="'$(MSBuildProjectExtension)' != '.vbproj'">$(IntermediateOutputPath)$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(GenerateDocumentationFile)' != 'true'">
<DocumentationFile />
</PropertyGroup>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.