【发布时间】:2016-10-23 22:59:09
【问题描述】:
所以当我启动我的 UWP 应用程序时,我会短暂地看到一个初始屏幕,然后在以下位置引发异常:
mscorlib.ni.dll!System.RuntimeTypeHandle.GetTypeByName(字符串名称, bool throwOnError, bool ignoreCase, bool reflectOnly, ref System.Threading.StackCrawlMark stackMark, System.IntPtr pPrivHostBinder, bool loadTypeFromPartialName) mscorlib.ni.dll!System.RuntimeType.GetType(string typeName, bool throwOnError, bool ignoreCase, bool reflectionOnly, ref System.Threading.StackCrawlMark stackMark) mscorlib.ni.dll!System.Type.GetType(string typeName, bool throwOnError) mscorlib.ni.dll!System.Resources.ResourceManager.GetWinRTResourceManager() mscorlib.ni.dll!System.Globalization.CultureInfo.GetCultureInfoForUserPreferredLanguageInAppX() mscorlib.ni.dll!System.Globalization.CultureInfo.CurrentCulture.get() mscorlib.ni.dll!System.IO.FileLoadException.FormatFileLoadExceptionMessage(string fileName = "System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", int hResult) mscorlib.ni.dll!System.IO.FileNotFoundException.SetMessageField() mscorlib.ni.dll!System.IO.FileNotFoundException.FileNotFoundException(string fileName, string fusionLog, int hResult)
除了“抛出异常:mscorlib.ni.dll 中的‘System.Exception’”之外没有其他详细信息。
运行不同的 UWP 应用程序(例如 UWP 空白模板应用程序)可以正常工作,但此应用程序似乎特别有此问题。
我可以使用我的应用程序的缩减版本重现该问题,如果需要可以downloaded here。
【问题讨论】:
-
应该是你的应用出现的异常。您必须设置断点才能找到不工作的部分。主页构造函数中可能有错误?还是在 App.Xaml.Cs OnLaunched 中?
-
永远不会命中应用程序构造函数 aka App() 上的断点。这是一个构造函数后问题。
-
您的应用是否在代表中,以便您比较差异?
-
它是,但这并没有提供任何洞察力,因为当我从存储库中检索它时,它需要修复才能编译。