Sandcastle 中未解决的程序集

Unresolved assembly in Sandcastle

我在 shfbproj 文件中为 Microsoft.OData.ProxyExtensions 配置了 Microsoft.OData.Client v 6.13.0。 Microsoft.OData.ProxyExtensions 根据 MS 网站上的信息接受任何 OData.Client >= 6.11.0,所以这应该是好的。 (这两个其实都是Office365.OutlookServices-V2.0导入的)但是我在使用Sandcastle编译项目API文档的时候遇到了如下错误。

<buildStep step="GenerateReflectionInfo">
Generating reflection information...
[C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe]
Build started 1/3/2017 11:08:08 AM.
Project &quot;C:\inetpub\wwwroot\AppServerDevHelp\Working\GenerateRefInfo.proj&quot; on node 1 (default targets).
PrepareForBuild:
  Creating directory &quot;obj\Debug\&quot;.
GenerateRefInfo:
  MRefBuilder (v2015.1.12.0)
  Copyright c 2006-2015, Microsoft Corporation, All Rights Reserved.
  Portions Copyright c 2006-2014, Eric Woodruff, All Rights Reserved.
  Loaded 2 assemblies for reflection and 44 dependency assemblies.
MRefBuilder : error : Unresolved assembly reference: Microsoft.OData.Client (Microsoft.OData.Client, Version=6.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) required by Microsoft.OData.ProxyExtensions [C:\inetpub\wwwroot\AppServerDevHelp\Working\GenerateRefInfo.proj]
    Last step completed in 00:00:02.3886
</buildStep>
<buildStep step="Failed">

SHFB: Error BE0043: Unexpected error detected in last build step.  See output above for details.
   at SandcastleBuilder.Utils.BuildEngine.BuildProcess.RunProcess(String fileToRun, String args)
   at SandcastleBuilder.Utils.BuildEngine.BuildProcess.Build()

</buildStep>

下面是我的shfbproj文件,OData.Client配置在最下面

  <?xml version="1.0" encoding="utf-8"?>
  <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
    <PropertyGroup>
      <!-- The configuration and platform will be used to determine which
           assemblies to include from solution and project documentation
           sources -->
      <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
      <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
      <SchemaVersion>2.0</SchemaVersion>
      <ProjectGuid>{0b7a8c51-1f48-436d-b9b6-9eb76b3ebd1e}</ProjectGuid>
      <SHFBSchemaVersion>1.9.5.0</SHFBSchemaVersion>
      <!-- AssemblyName, Name, and RootNamespace are not used by SHFB but Visual
           Studio adds them anyway -->
      <AssemblyName>Documentation</AssemblyName>
      <RootNamespace>Documentation</RootNamespace>
      <Name>Documentation</Name>
      <!-- SHFB properties -->
      <OutputPath>C:\inetpub\wwwroot\AppServerDevHelp\</OutputPath>
      <HtmlHelpName>x y Reference</HtmlHelpName>
      <FrameworkVersion>.NET Framework 4.0</FrameworkVersion>
      <HelpFileFormat>Website</HelpFileFormat>
      <DocumentationSources>
        <DocumentationSource sourceFile="zShared\zShared.csproj" />
        <DocumentationSource sourceFile="zWebService\zWebService.csproj" />
      </DocumentationSources>
      <WorkingPath>
      </WorkingPath>
      <SandcastlePath>
      </SandcastlePath>
      <ProjectLinkType>Local</ProjectLinkType>
      <HelpTitle>x y Reference</HelpTitle>
      <CopyrightText>x International Inc. 2017</CopyrightText>
      <CopyrightHref>http://www.x.com</CopyrightHref>
      <FeedbackEMailAddress>webapps.support%40x.com</FeedbackEMailAddress>
      <VisibleItems>Attributes, ExplicitInterfaceImplementations, InheritedMembers</VisibleItems>
      <SyntaxFilters>CSharp, VisualBasic, CPlusPlus, JScript, JavaScript</SyntaxFilters>
      <NamespaceSummaries>
        <NamespaceSummaryItem name="(global)" isDocumented="False" />
        <NamespaceSummaryItem name="zServer" isDocumented="False" />
        <NamespaceSummaryItem name="zServer.FilterBuilders" isDocumented="False" />
        <NamespaceSummaryItem name="zWebService" isDocumented="False" />
      </NamespaceSummaries>
      <PlugInConfigurations>
      </PlugInConfigurations>
      <RootNamespaceContainer>False</RootNamespaceContainer>
      <ComponentConfigurations>
        <ComponentConfig id="Code Block Component" enabled="True">
          <component id="Code Block Component" type="SandcastleBuilder.Components.CodeBlockComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
            <basePath value="{@HtmlEncProjectFolder}" />
            <outputPaths>{@HelpFormatOutputPaths}</outputPaths>
            <allowMissingSource value="false" />
            <removeRegionMarkers value="false" />
            <colorizer syntaxFile="{@SHFBFolder}Colorizer\highlight.xml" styleFile="{@SHFBFolder}Colorizer\highlight.xsl" stylesheet="{@SHFBFolder}Colorizer\highlight.css" scriptFile="{@SHFBFolder}Colorizer\highlight.js" language="cs" tabSize="0" numberLines="false" outlining="false" keepSeeTags="false" defaultTitle="true" />
          </component>
        </ComponentConfig>
      </ComponentConfigurations>
      <NamingMethod>MemberName</NamingMethod>
      <BuildLogFile>
      </BuildLogFile>
      <HtmlHelp1xCompilerPath>
      </HtmlHelp1xCompilerPath>
      <HtmlHelp2xCompilerPath>
      </HtmlHelp2xCompilerPath>
      <MissingTags>Summary, Parameter, Returns, AutoDocumentCtors, Namespace, TypeParameter, AutoDocumentDispose</MissingTags>
      <CollectionTocStyle>Flat</CollectionTocStyle>
      <SdkLinkTarget>Blank</SdkLinkTarget>
      <PresentationStyle>VS2010</PresentationStyle>
      <Preliminary>False</Preliminary>
      <Language>en-US</Language>
      <ContentPlacement>AboveNamespaces</ContentPlacement>
    </PropertyGroup>
    <!-- There are no properties for these groups.  AnyCPU needs to appear in
         order for Visual Studio to perform the build.  The others are optional
         common platform types that may appear. -->
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Win32' ">
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Win32' ">
    </PropertyGroup>
    <ItemGroup>
      <ProjectReference Include="zShared\zShared.csproj">
        <Name>zShared</Name>
        <Project>{3C5798A6-AE6B-45DE-8CC8-06708385E025}</Project>
      </ProjectReference>
    </ItemGroup>
    <ItemGroup>
      <Reference Include="ComWrapperLibrary">
        <HintPath>zWebService\bin\ComWrapperLibrary.dll</HintPath>
      </Reference>
      <Reference Include="zWebService">
        <HintPath>zWebService\bin\zWebService.dll</HintPath>
      </Reference>
      <Reference Include="Microsoft.OData.Client">
      <HintPath>packages\Microsoft.OData.Client.6.13.0\lib\net40\Microsoft.OData.Client.dll</HintPath>
      </Reference>
    </ItemGroup>
    <!-- Import the SHFB build targets -->
    <Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" />
  </Project>

虽然配置在 shfbproj 文件中,但 Sandcastle 似乎未能找到程序集。我想知道如何使用 v 6.13 解决此问题。

**** 请注意,我通过下载 6.11 OData.client 并更新了文件中的配置来修复此问题。但我不想这样,因为我必须维护两个几乎相同的程序集。只想要 6.13,谢谢

您可以使用 Assembly Binding Redirection 插件将 Microsoft.OData.Client@6.11.0.0 重定向到 Microsoft.OData.Client@6.13.0.0 或者您可以将 Microsoft.OData.Client 添加到程序集列表中,如果未解决则忽略。

请参阅 Assembly Binding Redirection plug-in 上的文档。

提示:我会使用 ConfigurationFile 选项,这样您就不必每次都更新绑定重定向版本更新您的依赖项。