【发布时间】:2023-03-20 22:43:02
【问题描述】:
我已经使用 NuGet Install-Package PayPal 安装了 PayPal
然后我使用这里的代码进行测试:https://devtools-paypal.com/guide/pay_paypal
Dictionary<string, string> sdkConfig = new Dictionary<string, string>();
sdkConfig.Add("mode", "sandbox");
string accessToken = new OAuthTokenCredential("XXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXX", sdkConfig).GetAccessToken();
我在此之后放置了一个断点进行检查,但是当我加载页面时,我得到:
Could not load file or assembly 'PayPal, Version=1.7.3.0, Culture=neutral, PublicKeyToken=5b4afc1ccaef40fb' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'PayPal, Version=1.7.3.0, Culture=neutral, PublicKeyToken=5b4afc1ccaef40fb' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
Line 22:
Line 23: return View();
Line 24: }
Line 25: }
Line 26: }
Source File: c:\users\david\documents\visual studio 2015\Projects\PayPal\PayPal\Controllers\HomeController.cs Line: 24
Assembly Load Trace: The following information can be helpful to determine why the assembly 'PayPal, Version=1.7.3.0, Culture=neutral, PublicKeyToken=5b4afc1ccaef40fb' could not be loaded.
关于如何解决这个问题的任何帮助?
编辑
我已经尝试了可能重复的链接中的答案,但它们都不适合我。
【问题讨论】:
-
您的项目是在一个解决方案中吗?还是您有多个项目/库等?
-
@JamesDev 多合一解决方案。我已经尝试了该链接上发布的有关重复问题的所有内容,但没有任何效果。
-
您能否在您的引用文件夹中右键单击 Paypal dll 并从那里检查版本并将其发布在此处。
-
@JamesDev 看起来是因为我将解决方案命名为“PayPal”
标签: c# asp.net asp.net-mvc paypal