Question

I'm building an android app with Xamarin that uses SkyDrive .Net API Client but I'm getting the following error when trying to run my android app on the emulator

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 Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 
  at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference) [0x00000] in <filename unknown>:0 
  at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences (System.Collections.Generic.List`1 assemblies, Mono.Cecil.AssemblyDefinition assembly, Boolean topLevel) [0x00000] in <filename unknown>:0 
  at Xamarin.Android.Tasks.ResolveAssemblies.Execute () [0x00000] in <filename unknown>:0  (MyApp)

Apparently i cannot use the System.Web assembly in Xamarin.Android. So, the question is if there is a way to load the missing assembly or i have to move to another API?

Thanks in advance

Was it helpful?

Solution

Did you compiled the client from source or just got it in binary form?

I suppose you got it already compiled, so it's a library naming difference between Xamarin and MS .net, there is no System.Web.dll (but nearly all the classes exists inside the System.Web namespace but they are on other libraries).

The solution is to download the client's source code, inside Xamarin Studio in your same solution add a new Android Library project, add all the code files from the client to that project, add any necessary reference and reference that project in your main project, in this way the correct libraries will be linked (if no class is missing, as I said there are barely all, but not all).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top