System.IO.FileNotFoundException:无法在Android版Mono中加载程序集System.Web [英] System.IO.FileNotFoundException: Could not load assembly System.Web in Mono for Android

查看:125
本文介绍了System.IO.FileNotFoundException:无法在Android版Mono中加载程序集System.Web的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Xamarin构建一个Android应用,该应用使用 SkyDrive .Net API客户端,但是我正在获取尝试在模拟器上运行我的android应用时出现以下错误

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)

显然,我不能在Xamarin.Android中使用System.Web程序集.因此,问题是是否有一种方法可以加载缺少的程序集,或者我必须移至另一个API?

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?

预先感谢

推荐答案

您是从源代码编译客户端还是以二进制形式获取客户端的?

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

我想您已经编译了它,所以它是Xamarin和MS .net之间的库命名差异,没有System.Web.dll(但是几乎所有类都存在于System.Web名称空间中,但是它们位于另一个库).

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).

解决方案是下载客户端的源代码,在同一解决方案的Xamarin Studio内添加一个新的Android Library项目,将来自客户端的所有代码文件添加到该项目,添加任何必要的引用,并在您的主目录中引用该项目项目,这样就可以链接正确的库(如果没有类丢失,正如我所说的,几乎没有,但不是全部).

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).

这篇关于System.IO.FileNotFoundException:无法在Android版Mono中加载程序集System.Web的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆