Xamarin iOS - 启动时无法加载文件或程序集“System.Threading.Tasks" [英] Xamarin iOS - Could not load file or assembly 'System.Threading.Tasks' at startup

查看:22
本文介绍了Xamarin iOS - 启动时无法加载文件或程序集“System.Threading.Tasks"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚升级到 Xamarin studio 5.9(内部版本 431),无法再运行我的项目.不过,它适用于一个干净的项目.

I just upgraded to Xamarin studio 5.9 (build 431), and cannot run my project anymore. It works with a clean project though.

当我运行我的应用程序时,我什至没有登陆 Main.

When I run my app, I don't even land in Main.

Xamarin Studio 中的应用程序输出打印了一堆程序集加载.它访问 MobileClientiOS.app/Newtonsoft.Json.dll [External],然后崩溃并显示以下输出:

The Application Output in Xamarin studio prints a bunch of assembly loadings. It gets to MobileClientiOS.app/Newtonsoft.Json.dll [External], then it crashes with the following output:

无法加载文件或程序集System.Threading.Tasks"或其其中之一依赖关系.该系统找不到指定的文件.(System.IO.FileNotFoundException) 在 System.AppDomain.Load(System.Reflection.AssemblyName assemblyRef,System.Security.Policy.Evidence assemblySecurity) [0x00081] in.../mono/mcs/class/corlib/System/AppDomain.cs:706 atSystem.AppDomain.Load (System.Reflection.AssemblyName assemblyRef)[0x00000] 在 .../mono/mcs/class/corlib/System/AppDomain.cs:674 中System.Reflection.Assembly.Load (System.Reflection.AssemblyNameassemblyRef) [0x00000] 中.../mono/mcs/class/corlib/System.Reflection/Assembly.cs:551 atObjCRuntime.Runtime.CollectReferencedAssemblies(System.Collections.Generic.List 1 程序集,System.Reflection.Assembly 程序集)[0x00019] in.../maccore/src/ObjCRuntime/Runtime.cs:218 atObjCRuntime.Runtime.CollectReferencedAssemblies(System.Collections.Generic.List 1 程序集,System.Reflection.Assembly 程序集)[0x0002c] in.../maccore/src/ObjCRuntime/Runtime.cs:220 atObjCRuntime.Runtime.CollectReferencedAssemblies(System.Collections.Generic.List 1 程序集,System.Reflection.Assembly 程序集)[0x0002c] in.../maccore/src/ObjCRuntime/Runtime.cs:220 atObjCRuntime.Runtime.RegisterEntryAssembly (System.Reflection.Assemblyentry_assembly) [0x0001b] 在.../maccore/src/ObjCRuntime/Runtime.cs:200 在ObjCRuntime.Runtime.RegisterEntryAssembly (IntPtr a) [0x00000] in.../maccore/src/ObjCRuntime/Runtime.cs:158 atObjCRuntime.Runtime.register_entry_assembly(IntPtr 程序集)[0x00000] 在 .../maccore/runtime/Delegates.generated.cs:118 at(包装本机到托管)ObjCRuntime.Runtime:register_entry_assembly (intptr) 2015-05-04

Could not load file or assembly 'System.Threading.Tasks' or one of its dependencies. The system cannot find the file specified. (System.IO.FileNotFoundException) at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x00081] in .../mono/mcs/class/corlib/System/AppDomain.cs:706 at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in .../mono/mcs/class/corlib/System/AppDomain.cs:674 at System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in .../mono/mcs/class/corlib/System.Reflection/Assembly.cs:551 at ObjCRuntime.Runtime.CollectReferencedAssemblies (System.Collections.Generic.List 1 assemblies, System.Reflection.Assembly assembly) [0x00019] in .../maccore/src/ObjCRuntime/Runtime.cs:218 at ObjCRuntime.Runtime.CollectReferencedAssemblies (System.Collections.Generic.List 1 assemblies, System.Reflection.Assembly assembly) [0x0002c] in .../maccore/src/ObjCRuntime/Runtime.cs:220 at ObjCRuntime.Runtime.CollectReferencedAssemblies (System.Collections.Generic.List 1 assemblies, System.Reflection.Assembly assembly) [0x0002c] in .../maccore/src/ObjCRuntime/Runtime.cs:220 at ObjCRuntime.Runtime.RegisterEntryAssembly (System.Reflection.Assembly entry_assembly) [0x0001b] in .../maccore/src/ObjCRuntime/Runtime.cs:200 at ObjCRuntime.Runtime.RegisterEntryAssembly (IntPtr a) [0x00000] in .../maccore/src/ObjCRuntime/Runtime.cs:158 at ObjCRuntime.Runtime.register_entry_assembly (IntPtr assembly) [0x00000] in .../maccore/runtime/Delegates.generated.cs:118 at (wrapper native-to-managed) ObjCRuntime.Runtime:register_entry_assembly (intptr) 2015-05-04

MobileClientiOS[77830:1943120] 严重:同时收到 SIGABRT执行本机代码.这通常表示在mono 运行时或您的应用程序使用的本机库之一.

MobileClientiOS[77830:1943120] critical: Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.

对不起,堆栈跟踪太长,但我没有想法.我们正在使用 PCL,但在这次 Xamarin Studio 升级之前没有出现问题.

Sorry for the long stacktrace, but I'm out of ideas. We are using PCL's, but there haven't been a problem before this Xamarin Studio-upgrade.

谢谢!

我降级了 Xamarin.iOS,它又可以正常工作了.它似乎失败的程序集是(现在适用于旧版本):

I downgraded Xamarin.iOS and it's working again. The assembly it seems to fail on is (which now works with the old version):

/MobileClientiOS.app/System.Xml.Linq.dll [外部]

/MobileClientiOS.app/System.Xml.Linq.dll [External]

如何才能运行最新版本?我不知道.

How to be able to run with the latest version? I do not know.

推荐答案

猜测一下,我认为这可能与 Xamarin 错误 29211.

To make a guess, I think this might have the same underlying cause as Xamarin Bug 29211.

如果这是真的,那么同样的解决方法很有可能会奏效:

If that's true, then there's a good chance the same workaround will work:

在项目选项 -> iOS 构建 -> 附加 mtouch 参数"下添加:

Under "project options -> iOS Build -> Additional mtouch arguments" add:

-linkskip=System.Threading.Tasks

-linkskip=System.Threading.Tasks

如果该解决方法确实有效,那么该问题很可能会在即将发布的服务版本(将于本周晚些时候发布)中得到解决.

If that workaround does indeed work, then it's very likely the issue will be fixed in the upcoming service release (due to be released later this week).

事实证明,System.Threading.Tasks 的问题还有另一个微妙不同的常见原因.第二个错误最初被错误 29211 隐藏,因为这两个错误非常相似.现在正在 Xamarin Bug 31560 中跟踪第二个问题.请注意,此错误仅影响模拟器构建并且具有相当简单的解决方法,因此其严重性较小.

It turns out there is another subtly different common cause of the problem for System.Threading.Tasks. That second bug was originally hidden by Bug 29211 because the two bugs are very similar. The second problem is now being tracked in Xamarin Bug 31560. Note that this bug only affects simulator builds and has fairly simple workarounds, so it is minor in severity.

这篇关于Xamarin iOS - 启动时无法加载文件或程序集“System.Threading.Tasks"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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