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 188.8.131.52 (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=184.108.40.206, 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 220.127.116.11 is being referenced. Looking at the files in my project at the sections that relate to the CertMgmt.SDK or Polly, I see:
<dependentAssembly> <assemblyIdentity name="Polly" publicKeyToken="c8a3ffc3f8f825cc" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-18.104.22.168" newVersion="22.214.171.124"/> </dependentAssembly>
<package id="Polly" version="7.2.0" targetFramework="net462" /> <package id="CertMgmt.SDK" version="126.96.36.199" targetFramework="net462" />
In my project's .csproj file
<Reference Include="Polly, Version=188.8.131.52, 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=184.108.40.206, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\packages\CertMgmt.SDK.220.127.116.11\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.
User contributions licensed under CC BY-SA 3.0