cancel
Showing results for 
Search instead for 
Did you mean: 

Does Authorize.Net work with Xamarin.Android?

I am trying to run the sample code posted on the following github link. I already signed up for the sandbox account and can confirm the posted code works when I run it through a console application.

 

However, it will throw errors when I tried it on my Xamarin.Android project.

The first error it throws is:

Severity Code Description Project File Line Suppression State
Error Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'System.Web.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
at Xamarin.Android.Tasks.ResolveAssemblies.Execute() AuthorizeNetTest

 

This issue was fixed when I included the System.Web.dll reference to the project.

 

With that the application does run but it will soon encounter another error after trying to execute the following line of code:

controller.Execute();

 

It will give off the following error message:

System.TypeInitializationException: The type initializer for 'AuthorizeNet.Util.HttpUtility' threw an exception.

 

Please provide assistance as to how to solve this issue.

 

PS: The SDK was installed successfully in the nuget package manager using the following command - Install-Package AuthorizeNet

jsmith99
Member
2 REPLIES 2

Hello @jsmith99

 

Xamarin.Android isn't currently one of our target platforms.  


You are welcome to post this as a new feature using our Ideas forum. This will allow others to vote on and make suggestions to improve the request.

Richard

RichardH
Administrator Administrator
Administrator

Can you advise if AuthorizeNet package works for Xamarin iOS?   And have plans changed at all now fo r Android support ?

baxtercr
Member