簡體   English   中英

C#ASP.NET MVC PayPal未找到程序集

[英]C# ASP.NET MVC PayPal not finding assembly

我已經使用NuGet Install-Package 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.

對如何解決這個有幫助嗎?

編輯

我嘗試了從給出的可能重復項的鏈接中獲得的答案,但這些都不對我有用。

我剛剛將我的代碼復制到一個新的解決方案中,並且可以正常工作。 我唯一能想到的是,因為我將解決方案命名為“ PayPal”,這在某處引起了問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM