1

我正在尝试使用 Sandcastle Help File Builder 为我的应用程序构建文档。我将 Msdn 缓存组件添加到 .shfbproj 文件中,如下所示:

<ComponentConfigurations>
  <ComponentConfig id="Cached MSDN URL References" enabled="True" xmlns="">
    <component id="Cached MSDN URL References" type="SandcastleBuilder.Components.CachedResolveReferenceLinksComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll" locale="{@Locale}" linkTarget="{@SdkLinkTarget}">
      <cache filename="$(MsdnCachePath)" />
      <targets base="{@SandcastlePath}Data\Reflection" recurse="true" files="*.xml" type="{@SDKLinks}" />
      <targets files="reflection.xml" type="{@ProjectLinks}" />
    </component>
  </ComponentConfig>
</ComponentConfigurations>

$(MsdnCachePath) 属性的值为:

<MsdnCachePath>$(MSBuildProjectDirectory)\Cache\MsdnUrl.cache</MsdnCachePath>

问题是生成帮助文件后,此缓存文件未在此位置创建。有什么想法为什么不会发生?

4

1 回答 1

2

这是因为 ComponentConfigurations 部分不包含由 MSBuild 执行的 MSBuild 代码。ComponentConfigurations 是一个包含 XML 数据的属性,该数据将被传递给相关组件并由组件框架解析。这通过使用“SHFB”属性来表示,例如

{@SandcastlePath}

这不是 MSBuild 属性。因此,常规 $(..) 属性在此 xml 中不起作用。

于 2009-03-26T09:01:54.477 回答