Unresolved assembly reference: System (System, Version=2.0.5.0 ...

Topics: User Forum
Dec 31, 2013 at 7:05 AM
Edited Dec 31, 2013 at 7:06 AM
Hi,

We have a project that uses a Portable Code Library for shared use between Silverlight and .NET.

When we build the help file we get an error:
Generating reflection information...
[C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe]
  MRefBuilder (v2.7.4.0)
  Copyright c 2006-2013, Microsoft Corporation, All Rights Reserved.
  Portions Copyright c 2006-2013, Eric Woodruff, All Rights Reserved.
  Info: Loaded 3 assemblies for reflection and 2 dependency assemblies.
MREFBUILDER : error : Unresolved assembly reference: System (System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes) required by Mapping.Portable [C:\Users\david_000\Documents\Projects\_svn\HelpFiles\Help\Working\GenerateRefInfo.proj]
    Last step completed in 00:00:01.7601
I have tried adding manual References to System 2/4, WindowsCodeBase and a bunch of other suggestions but it makes no difference. This is 1.9.8.0 SHFB.

Any ideas?

Thanks, Dave
Coordinator
Dec 31, 2013 at 6:18 PM
Edited Dec 31, 2013 at 6:19 PM
Rather than adding the references which won't work in this case, use the binding redirection plug-in to redirect the 2.0.5.0 version to the .NET/Silverlight version that is being used in the documented assembly.

Eric
Dec 31, 2013 at 7:04 PM
Edited Dec 31, 2013 at 7:17 PM
Hi Eric,

Thank you for your reply. That sounds exactly what I need. When I try it, it doesn't appear to resolve still:
Generating API filter for MRefBuilder...
    Last step completed in 00:00:00.0280
-------------------------------
Generating reflection information...
Adding binding redirections to assembly resolver configuration:
    System, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Version(s) 2.0.5.0 redirect to Version 4.0.0.0
Adding ignored assembly names to assembly resolver configuration:
    BusinessObjects.Licensing.KeycodeDecoder
[C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe]
  MRefBuilder (v2.7.4.0)
  Copyright c 2006-2013, Microsoft Corporation, All Rights Reserved.
  Portions Copyright c 2006-2013, Eric Woodruff, All Rights Reserved.
  Info: Loaded assembly binding redirect: System, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Version(s) 2.0.5.0 redirect to Version 4.0.0.0
  Info: Loaded 3 assemblies for reflection and 2 dependency assemblies.
MREFBUILDER : error : Unresolved assembly reference: System (System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes) required by Mapping.Portable [C:\Users\david_000\Documents\Projects\_svn\HelpFiles\Help\Working\GenerateRefInfo.proj]
    Last step completed in 00:00:05.1383
-------------------------------

SHFB: Error BE0043: Unexpected error detected in last build step.  See output above for details.

Any ideas?

Edit: I have versions 2.0.0.0 and 4.0.0.0 of System assembly listed in the GAC and the option checked in the redirect plugin to resolve from GAC.

I also tried manually adding them to the References section, along with trying both versions.

Thanks, Dave
Coordinator
Dec 31, 2013 at 7:39 PM
That's caused by a bug I fixed recently. You might be able to work around it by adding ", Retargetable=Yes" to the public key token in the configuration settings. The fix I applied was to ignore the "retargetable" part. That will be in the next release. The workaround doesn't fix it, you can add it as an ignored assembly instead for the time being.

Eric
Dec 31, 2013 at 8:02 PM
EWoodruff wrote:
That's caused by a bug I fixed recently. You might be able to work around it by adding ", Retargetable=Yes" to the public key token in the configuration settings. The fix I applied was to ignore the "retargetable" part. That will be in the next release. The workaround doesn't fix it, you can add it as an ignored assembly instead for the time being.

Eric
Thank you Eric.

I tried the workaround with and without spaces but that didn't appear to work.

Ignoring the System assemblies it had issues with did work, and the file compiles.

Many thanks and Happy New Year!

Dave