located assembly's manifest definition does not match the assembly reference

1

I've got a console EXE written in C# in Visual Studio 2015. Originally in .Net 4.62. It uses some dependencies on a package called 'CertMgmt.SDK' which is internal to our company. That package has a dependency on another package called 'Polly'. Right now the internal cert management package (CertMgmt.SDK) is version 1.0.2.2 (though that probably doesn't matter terribly) and the Polly package is 7.2.0. Both are the latest versions I can get from our company's internal NuGet package sources (which I have to use). Everything builds fine, but when I run it, I get:

Unhandled Exception: System.ApplicationException: An error occurred with following message: Could not load file or assembly 'Polly, Version=6.0.0.0, Culture=neutral, PublicKeyToken=c8a3ffc3f8f825cc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

This is when I attempt to call a function from CertMgmt.SDK.

I can't figure out where this Polly version 6.0.0.0 is being referenced. Looking at the files in my project at the sections that relate to the CertMgmt.SDK or Polly, I see:

App.Config:

      <dependentAssembly>
        <assemblyIdentity name="Polly" publicKeyToken="c8a3ffc3f8f825cc" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-7.2.0.0" newVersion="7.2.0.0"/>
      </dependentAssembly>

packages.Config

  <package id="Polly" version="7.2.0" targetFramework="net462" />
  <package id="CertMgmt.SDK" version="1.0.2.2" targetFramework="net462" />

In my project's .csproj file

<Reference Include="Polly, Version=7.2.0.0, Culture=neutral, PublicKeyToken=c8a3ffc3f8f825cc, processorArchitecture=MSIL">
  <HintPath>..\packages\Polly.7.2.0\lib\net461\Polly.dll</HintPath>
  <Private>True</Private>
</Reference>

<Reference Include="CertMgmt.SDK, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\packages\CertMgmt.SDK.1.0.2.2\lib\net462\CertMgmt.SDK.dll</HintPath>
  <Private>True</Private>
</Reference>

I can't seem to find any other reference to that Polly package. I have removed the section from the App.Config which didn't seem to make a difference. I also tried to downgrade but our package source only has 6.0.1 and not 6.0.0 and even with that I got the same error message. Forcing it to try to get 6.0.0 builds with a package not found error. I've done a project clean also with no luck.

c#
manifest
polly
asked on Stack Overflow Jan 15, 2020 by Seril

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0