the type initializer for '' threw an exception 问题:程序启动时初始化主窗口类时,弹出该错误.调查:查看类的构造函数是否会有异常抛出.解决:去掉类的构造函数中可能出现的异常. ////////////////////// 环境:windows 2003 x64,Oracle 10g x64,odp.net(正确安装),.net framework 4 问题:.net应用程序通过Oracle.DataAccess.dll访问64位的Oracle服务器,…
对于C#中异常:“The type initializer to throw an exception(类型初始值设定项引发异常)”的简单分析,目前本人分析两种情况,如下: 情况一: 借鉴麒麟.NET的类型初始值设定项引发异常文章!!!写的很详细,大家可以看一看! 其实麒麟.NET的这篇文章主要讲解分析了静态成员的方面,总的说就是:类型初始化或访问类型的静态成员时,都会对类中的其他静态成员进行初始化,如果有静态构造函数的话,一并执行静态构造函数.在这过程中所引发的异常我就直接借鉴麒麟.NET的例…
原文:https://www.cnblogs.com/pudefu/p/7580722.html 在.NET Framework框架时代我们的应用配置内容一般都是写在Web.config或者App.config文件中,读取这两个配置文件只需要引用System.Configuration程序集,分别用 System.Configuration.ConfigurationManager.AppSettings["SystemName"];//读取appSettings配置 System.C…
使用Spire组件抛出异常The type initializer for 'spr857' threw an exception 我使用免费的Spire.Xls组件尝试去转换Excel文档到PDF文档,在执行下面第二行代码,也就是做加载文档这步时,抛出了异常“The type initializer for 'spr857' threw an exception” Workbook workbook = new Workbook(); workbook.LoadFromFile("D:\\sa…
[15/08/19 00:03:10] [DataManager-7292-ERROR] System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'System.Data.Entity.Internal.AppConf…
08-31 17:02:03: ### DEBUG ##########################System.TypeInitializationException: The type initializer for 'Mono.Unix.Native.Stdlib' threw an exception. ---> System.DllNotFoundException: /usr/lib/libMonoPosixHelper.so  at (wrapper managed-to-na…
 Change the "System.Drawing" reference of "CoreCompat.System.Drawing"if you throw The type initializer for 'System.Drawing.KnownColors' threw an exception     to do:apt-get install libgdiplus …
ASP.NET Core项目部署在Linux下可能会出现GDI错误 The type initializer for 'Gdip' threw an exception 解决方案:创建 libdl 的软链接 # /lib/x86_64-linux-gnu/libdl* sudo ln -s /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libdl.so或sudo ln -s /lib/x86_64-linux-gnu/libdl-2…
The type initializer for System.Data.SqlClient.SqlConnection threw an exception net framwork啥原因 xp电脑…
.net应用程序通过Oracle.DataAccess.dll访问64位的Oracle服务器,在连接时出现以下异常:“System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception. ---> Oracle.DataAccess.Client.OracleException: 提供程序与此版本的 Oracle 客户…