내 페이지가 열리면 내 Xamarin.Forms 앱이 계속 충돌합니다. 크래시는 재현 가능하지만 릴리스 모드에서만 발생합니다. 빌드 및 디버그 모드에서 응용 프로그램을 실행할 때 동일한 페이지가 잘 열립니다.Xamarin.Forms 응용 프로그램이 InitializeComponent의 FileNotFoundException과 충돌합니다.
일부 노력으로 나는 예외를 잡아 내고 앱이 닫히기 전에 메시지 창에 스택 추적을 표시했습니다. 핵심 오류 내 페이지가 InitializeComponent
메소드를 호출 할 때 조립 어딘가에 실행 XamlLoader
의 XamlParser
의 System.Runtime
에 대한 FileNotFoundException
것 같다 :
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime' or one of its dependencies
File name: 'System.Runtime'
at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity)
at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef)
at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName)
at System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef)
at Xamarin.Forms.Xaml.XamlParser.GetElementType (Xamarin.Forms.Xaml.XmlType xmlType, IXmlLineInfo xmlInfo, System.Reflection.Assembly currentAssembly, Xamarin.Forms.Xaml.XamlParseException& exception)
at Xamarin.Forms.Xaml.CreateValuesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, INode parentNode)
at Xamarin.Forms.Xaml.ElementNode.Accept (IXamlNodeVisitor visitor, INode parentNode)
at Xamarin.Forms.Xaml.RootNode.Accept (IXamlNodeVisitor visitor, INode parentNode)
at Xamarin.Forms.Xaml.XamlLoader.Visit (Xamarin.Forms.Xaml.RootNode rootnode, Xamarin.Forms.Xaml.HydratationContext visitorContext)
at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.String xaml)
at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.Type callingType)
at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[TXaml] (Xamarin.Forms.Xaml.TXaml view, System.Type callingType)
at MyApp.MyNamespace.Pages.MyPage.InitializeComponent()
at MyApp.MyNamespace.Pages.MyPage..ctor()