Unresolved assembly reference with sandcastle

2019-04-05 15:38发布

问题:

I am trying to generate documentation with sandcastle help file builder. While building the project in the sandcastle i am getting the following error.

MRefBuilder : error : Unresolved assembly reference: Microsoft.Owin (Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) required by Microsoft.AspNet.Identity.Owin [C:\Users\inkosah\Documents\Help\Working\GenerateRefInfo.proj]
Last step completed in 00:01:19.4610

Can anybody help me to resolve this issue? I also tried adding it separately to project references in the sandcastle but no help.

回答1:

Solution 1 : Add missing references to a dummy project.

  1. Create 'dummyProject' (ie class library)
  2. In Visual Studio - Package Manager Console

    Install-Package Microsoft.Owin -Version 2.1.0.0 -ProjectName dummyProject

    Install-Package Microsoft.Owin.Security.OAuth -version 2.1.0.0 -ProjectName dummyProject

  3. In Sandcastle Help Fil Builder - Project Explore, add two references

    Microsoft.aspNet.identity.Owin (dll found in ..\packages\Microsoft.AspNet.Identity.Owin.2.2.0\lib\net45)

    Microsoft.Owin (dll found in ..\packages\Microsoft.Owin.2.1.0\lib\net45\Microsoft.Owin.dll)

It looks like MRefBuilder found that Microsoft.AspNet.Identity.Owin relies on Microsoft.Owin (== v 2.1.0) and not Microsoft.Owin (>= 2.1.0).

The main project is still using Microsoft.Owin 3.0.1.0

Solution 2 : Ignore unresolved references

In Documentation (or SHFB) Project Properties / Plug-Ins :

  1. Add "Assembly Binding Redirection" in "Plugs-Ins in This Project"
  2. configure it to "ignore if Unresolved" "Microsoft.Owin" and "Microsoft.Owin.Security.OAuth"