Xamarin.Forms.Forms.Init(e) FileNotFoundExeception in Onlaunched

雨燕双飞 提交于 2019-12-11 07:06:38

问题


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)

This is the error I'm getting:

System.IO.FileNotFoundException: 'Could not load file or assembly 'clrcompression, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.'

It completely makes my app crash, only thing I can see is my Splashscreen.

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");


回答1:


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

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.



来源:https://stackoverflow.com/questions/44950276/xamarin-forms-forms-inite-filenotfoundexeception-in-onlaunched

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!