I am using Netonsoft.Json in my project. It works fine until I start integrating Paypal SDK into my project. My code is as follows.
String AccessToken = new PayPal.OAuthTokenCredential("", "").GetAccessToken(); ---->>>> This Line Throwing An Error PayPal.Api.Payments.Address add = new PayPal.Api.Payments.Address(); add.city = TextBoxCity.Text; add.line1 = TextBoxAddress.Text; add.phone = TextBoxPhoneNumber.Text; add.postal_code = TextBoxZipcode.Text; add.state = TextBoxState.Text; PayPal.Api.Payments.CreditCard cc = new PayPal.Api.Payments.CreditCard(); cc.number = TextBoxCreditCardNumber.Text; cc.first_name = TextBoxFirstName.Text; cc.last_name = TextBoxLastName.Text; cc.expire_month = Convert.ToInt16(TextBoxExpiryMonth.Text); cc.expire_year = Convert.ToInt16(TextBoxExpiryYear.Text); cc.cvv2 = TextBoxCVVNumber.Text; cc.billing_address = add; cc.Create(AccessToken);
and I get an error as below
System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I am searching the Internet and found some solution to modify the configuration file. SO I am changing my configuration file below
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-3.5.0.0" newVersion="4.5.0.0" /> </dependentAssembly> </assemblyBinding>
I also deal with assembly properties like Copy Local, Specific Version, but nothing helps me solve this problem. How can I resolve the build conflict?
c # .net-assembly paypal-sandbox
Hiren Jul 21 '13 at 19:35 2013-07-21 19:35
source share