简体   繁体   English

无法加载文件或程序集“BouncyCastle.Crypto, Version=1.8.1.0, Culture=neutral, PublicKeyToken=null”或其依赖项之一

[英]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.我正在尝试将 Walmart .NET SDK 集成到 .NET 4.61 MVC 5 应用程序中。 Using NuGet, I added a reference to BouncyCastle.Crypto 1.8.1.0.使用 NuGet,我添加了对 BouncyCastle.Crypto 1.8.1.0 的引用。

The SDK uses .NET Standard 1.3 and it references BouncyCastle.Crypto 1.8.1.3: SDK 使用 .NET Standard 1.3 并引用 BouncyCastle.Crypto 1.8.1.3:

https://github.com/walmartlabs/partnerapi_sdk_dotnet https://github.com/walmartlabs/partnerapi_sdk_dotnet

1.8.1.3 is not available for .NET 4.61. 1.8.1.3 不适用于 .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.

I had to use the .NET 46 solution.我不得不使用 .NET 46 解决方案。 The Walmart.Sdk.Base assembly is built on .NET Standard 1.3. Walmart.Sdk.Base 程序集基于 .NET Standard 1.3 构建。 I needed to reference the one for .NET 4.6.我需要引用 .NET 4.6 的那个。

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.我的问题是在同一个解决方案中同时构建一个项目,该解决方案通过 NuGet 引用一个较旧的库,有时它会覆盖最新的库。 Upgrading the NuGet package in this project fixed the issue.升级此项目中的 NuGet 包修复了该问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C#:无法加载文件或程序集'OpenPop,Version = 2.0.4.369,Culture = neutral,PublicKeyToken = null'或其依赖项之一 - C#: Could not load file or assembly 'OpenPop, Version=2.0.4.369, Culture=neutral, PublicKeyToken=null' or one of its dependencies 无法加载文件或程序集'XXX,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null'或其依赖项之一 - Could not load file or assembly 'XXX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies 无法加载文件或程序集'Dapper,Version = 1.8.0.0,Culture = neutral,PublicKeyToken = null'或其依赖项之一 - Could not load file or assembly 'Dapper, Version=1.8.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies 无法加载文件或程序集'System,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = 561934e089'或其依赖项之一 - Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=561934e089' or one of its dependencies 无法加载文件或程序集“Microsoft.SqlServer.Types, Version=12.0.0.0, Culture=neutral, PublicKeyToken=myKey”或其依赖项之一。 - Could not load file or assembly 'Microsoft.SqlServer.Types, Version=12.0.0.0, Culture=neutral, PublicKeyToken=myKey' or one of its dependencies. 无法加载文件或程序集'itextsharp,Version = 5.5.0.0,Culture = neutral,PublicKeyToken = 8354ae6d2174ddca'或其依赖项之一 - Could not load file or assembly 'itextsharp, Version=5.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its dependencies 无法加载文件或程序集“Microsoft.Bcl.AsyncInterfaces,Version=1.0.0.0,Culture=neutral,PublicKeyToken=XX”或其依赖项之一 - Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XX' or one of its dependencies 无法加载文件或程序集“工具,版本= 4.5.0.0,区域性=中性,PublicKeyToken = f7660c0f5438cda5”或其依赖项之一 - Could not load file or assembly 'Tools, Version=4.5.0.0, Culture=neutral, PublicKeyToken=f7660c0f5438cda5' or one of its dependencies 无法加载文件或程序集“系统,版本=4.0.0.0,文化=中性,PublicKeyToken=b77a5c561934e089”或其依赖项之一 - Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies Nuget -“无法加载文件或程序集'{类名},版本 = xxx,文化 = 中性,PublicKeyToken = null'或其依赖项之一” - Nuget - " Could not load file or assembly '{Class Name}, Version= x.x.x., Culture=neutral, PublicKeyToken=null' or one of its dependency"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM