抛出异常:' System.Exception'在UWP App上的mscorlib.ni.dll启动

时间:2016-06-22 06:54:24

标签: 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)

除了&#34之外没有进一步的细节;抛出异常:' System.Exception'在mscorlib.ni.dll"。

运行其他UWP应用程序,例如UWP空白模板应用程序正常,但此应用程序似乎特别有此问题。

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

1 个答案:

答案 0 :(得分:1)

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

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