Unresolved assembly in Sandcastle

628 views Asked by At

I configured Microsoft.OData.Client v 6.13.0 for Microsoft.OData.ProxyExtensions in shfbproj file. Microsoft.OData.ProxyExtensions accepts any OData.Client >= 6.11.0 based on the information on MS website, so this should be good. (Both of them are actually imported by Office365.OutlookServices-V2.0) However, I met the following error when I used Sandcastle to compile the project API documentation.

<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>

Below is my shfbproj file, the OData.Client configuration is at the bottom

  <?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>

It seems Sandcastle failed to find the assembly though the configuration was in shfbproj file. I was wondering how I can fix this with v 6.13.

**** Please note, I fixed this by downloading 6.11 OData.client and updated the configuration in the file. But I don't want this way as I have to maintain two almost same assembly. Only want 6.13, thanks

1

There are 1 answers

1
tokafew420 On BEST ANSWER

You can use the Assembly Binding Redirection plug-in to either redirect [email protected] to [email protected] or you can add Microsoft.OData.Client to the list of assemblies to ignore if unresolved.

See the documentation on Assembly Binding Redirection plug-in.

Tip: I'd use the ConfigurationFile option so that you don't have to update the binding redirection versions each time you update your dependencies.