Xamarin.Forms.Forms.Init(e)在启动时FileNotFoundExeception [英] Xamarin.Forms.Forms.Init(e) FileNotFoundExeception in Onlaunched
问题描述
我的Android应用程序运行良好,但是当我启动UWP应用程序时,它在Xamarin.Forms.Forms.Init(e)行的App.xaml.cs的OnLaunched中崩溃了
My Android Application works fine but when I launch my UWP application it crashes in the OnLaunched of my App.xaml.cs at the line of Xamarin.Forms.Forms.Init(e)
这是我得到的错误:
System.IO.FileNotFoundException:'无法加载文件或程序集 "clrcompression,文化=中性,PublicKeyToken =空".系统 找不到指定的文件.'
System.IO.FileNotFoundException: 'Could not load file or assembly 'clrcompression, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.'
这完全使我的应用崩溃,只有我能看到的是我的Splashscreen.
It completely makes my app crash, only thing I can see is my Splashscreen.
在IOS中也遇到了类似的问题.它还显示了FileNotFoundexception错误,但是它没有中断,我可以通过它.它在UIApplication.Main(args,null,"AppDelegate");行的Main.cs中显示错误;
In IOS got a similar issue. It also show an error of FileNotFoundexception but it doesn't break and I can go past it. It show the error in my Main.cs at the line of UIApplication.Main(args, null, "AppDelegate");
推荐答案
正如原始帖子的注释中所讨论的,对于在同一线程中偶然跌倒的其他人,在大多数情况下,原因似乎是与Xlabs程序集有关的问题,可能是未正确加载或尚未完全删除.至少在过去半年中,这似乎一直是一个问题(类似情况的过去示例可以在
As discussed in the comments of the original post, and for anyone else that stumbles accross this thread with the same exception, in most instances the cause would appear to be related to Xlabs assemblies either not loading correctly, or having not been removed completely. This appears to have been an issue for at least the last half a year (past example of similar situation can be found Here).
在这种情况下,如果删除xlab引用但仍然出现错误,则解决方案是从项目文件夹中删除obj/bin/.VS文件夹.然后对于UWP项目,重新生成然后部署.该问题应得到解决.
The solution in this instance if you removed the xlab references but still get the error, is to delete the obj/bin/.VS folders from your project folder. Then for a UWP project, rebuild and then deploy. The issue should be resolved.
这篇关于Xamarin.Forms.Forms.Init(e)在启动时FileNotFoundExeception的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!