首页 文章

抛出异常:在UWP App Start上的mscorlib.ni.dll中出现'System.Exception'

提问于
浏览
2

因此,当我启动我的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.File NotFoundException.FileNotFoundException(string fileName,string fusionLog,int hResult)

除了“mscorlib.ni.dll中的异常抛出:'System.Exception'”之外,没有其他详细信息 .

运行不同的UWP应用程序,如UWP空白模板应用程序工作正常但这个应用程序似乎特别有这个问题 .

我可以使用我的应用程序的减少版本重现问题,如果需要可以downloaded here .

1 回答

  • 1

    事实证明我的应用程序包已损坏,或者我从[%localappdata%\ packages]中删除了包 . 您可以在包装部分下的包清单中找到您的包名称 .

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

相关问题