Joseph Anderson
Joseph Anderson

Reputation: 4144

Could not load file or assembly 'BouncyCastle.Crypto, Version=1.8.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies

I am trying to integrate the Walmart .NET SDK into a .NET 4.61 MVC 5 app. Using NuGet, I added a reference to BouncyCastle.Crypto 1.8.1.0.

The SDK uses .NET Standard 1.3 and it references BouncyCastle.Crypto 1.8.1.3:

https://github.com/walmartlabs/partnerapi_sdk_dotnet

1.8.1.3 is not available for .NET 4.61.

{"Could not load file or assembly 'BouncyCastle.Crypto, Version=1.8.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"BouncyCastle.Crypto, Version=1.8.1.0, Culture=neutral, PublicKeyToken=null"}

=== Pre-bind state information ===
LOG: DisplayName = BouncyCastle.Crypto, Version=1.8.1.0, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = file:///C:/Users/example_user/Source/Workspaces/CCC/Test/example_app.Test.DataAccessUnitTest/bin/Debug
LOG: Initial PrivatePath = NULL
Calling assembly : Walmart.Sdk.Base, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\example_user\Source\Workspaces\CCC\Test\example_app.Test.DataAccessUnitTest\bin\Debug\example_app.Test.DataAccessUnitTest.dll.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/example_user/Source/Workspaces/CCC/Test/example_app.Test.DataAccessUnitTest/bin/Debug/BouncyCastle.Crypto.DLL.
LOG: Attempting download of new URL file:///C:/Users/example_user/Source/Workspaces/CCC/Test/example_app.Test.DataAccessUnitTest/bin/Debug/BouncyCastle.Crypto/BouncyCastle.Crypto.DLL.
LOG: Attempting download of new URL file:///C:/Users/example_user/Source/Workspaces/CCC/Test/example_app.Test.DataAccessUnitTest/bin/Debug/BouncyCastle.Crypto.EXE.
LOG: Attempting download of new URL file:///C:/Users/example_user/Source/Workspaces/CCC/Test/example_app.Test.DataAccessUnitTest/bin/Debug/BouncyCastle.Crypto/BouncyCastle.Crypto.EXE.

Upvotes: 5

Views: 36797

Answers (3)

Neo4242
Neo4242

Reputation: 35

This error says.. BouncyCastle.Crypto.dll file is not exist in the project bin folder. I placed to dll file into the bin folder from my old project. Thats work for me.

Upvotes: 0

ceztko
ceztko

Reputation: 15217

My issue was a project building concurrently in the same solution which was referencing an older library through NuGet and occasionally it was overwriting the most recent one. Upgrading the NuGet package in this project fixed the issue.

Upvotes: 3

Joseph Anderson
Joseph Anderson

Reputation: 4144

I had to use the .NET 46 solution. The Walmart.Sdk.Base assembly is built on .NET Standard 1.3. I needed to reference the one for .NET 4.6.

Upvotes: 2

Related Questions