c# - UWP App Start 抛出异常 : 'System.Exception' in mscorlib. ni.dll

标签 c# dll uwp

因此,当我启动我的 UWP 应用程序时,我会短暂地看到启动画面,然后在以下位置引发异常:

mscorlib.ni.dll!System.RuntimeTypeHandle.GetTypeByName(string name, bool throwOnError, bool ignoreCase, bool reflectionOnly, 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 .

最佳答案

原来我的应用程序包已损坏或其他原因,所以我从 [%localappdata%\packages] 中删除了该程序包。您可以在打包部分下的包 list 中找到您的包名称。

我通过查找我在事件查看器中遇到的错误来解决这个问题,Microsoft 的 KB 说我应该在机器上重新创建我的用户帐户,以便我得到一个新的包文件夹。但我发现只需删除项目的包即可解决问题。

关于c# - UWP App Start 抛出异常 : 'System.Exception' in mscorlib. ni.dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37960616/

相关文章:

deployment - Windows Server 2016 上的远程调试 UWP 应用

c# - 如何在循环内的 C# 中添加 TimeSpan?

c# - 如何通过基类中的方法返回通用类型?

c# - PinvokeStackImbalance 错误 (C#)

c++ - 以可移植的方式将类导出到 dll,而不使用接口(interface)?

c# - ISupportIncrementalLoading 加载比需要更多的项目

c# - 使用 MEF 延迟加载 DLL

c# - 不清晰的转换图像。 wmf转png

java - 如何制作包含DLL的Jar?

visual-studio - UWP平台上的FFmpeg.AutoGen