简体   繁体   English

外部代码中的System.TypeInitializationException

[英]System.TypeInitializationException in external code

Just upgraded my PC to Windows 10 (from 8.1), and installed Visual Studio 2015 as well. 刚刚将我的PC升级到Windows 10(从8.1开始),还安装了Visual Studio 2015。 When trying to debug a program I've been working on for a while, I immediately get an exception saying An unhandled exception of type 'System.TypeInitializationException' occurred in mscorlib.dll , and I am not getting a view of the code which throws it. 当尝试调试我已经工作了一段时间的程序时,我立即收到一个异常,指出An unhandled exception of type 'System.TypeInitializationException' occurred in mscorlib.dll ,并且我没有看到抛出的代码它。

With that in mind and that the callstack only shows one thing which is External Code with the Language field blank, I suspect there is some .dll which isn't there, or is incompatible. 考虑到这一点,并且调用堆栈仅显示一件事,即“ External Code而“语言”字段为空白,我怀疑其中有些.dll不存在或不兼容。

What I'm wondering is how I can find the piece of code or file which is giving me this problem, cause I am clueless as to what to do next.. 我想知道的是如何找到出现此问题的代码或文件,因为我不知道下一步该怎么做。

好的,因此,在Internet上搜寻类似问题约两个小时之后,我发现搜索静态初始化可能会解决我的问题,并且通过其他侦探工作,我设法找到了静态类中的数据文件由于该特定文件夹中的securityprivileges而无法读取,这又给了我这个例外。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM