“System.Data.SqlClient.SqlConnection”的类型初始值设定项引发异常。
呦呦 2011-05-09 04:10:18 System.TypeInitializationException: “System.Data.SqlClient.SqlConnection”的类型初始值设定项引发异常。 ---> System.TypeInitializationException: “System.Data.SqlClient.SqlConnectionFactory”的类型初始值设定项引发异常。 ---> System.TypeInitializationException: “System.Data.SqlClient.SqlPerformanceCounters”的类型初始值设定项引发异常。 ---> System.Configuration.ConfigurationErrorsException: 配置系统未能初始化 ---> System.Configuration.ConfigurationErrorsException: 无法识别的配置节 EncryptedData。 (D:\Item\C#操作XML\EncryptConfig\EncryptConfig\bin\Debug\EncryptConfig.vshost.exe.Config line 2)
在 System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
在 System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
在 System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
在 System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
--- 内部异常堆栈跟踪的结尾 ---
在 System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
在 System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName)
在 System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
在 System.Configuration.ConfigurationManager.GetSection(String sectionName)
在 System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
在 System.Diagnostics.DiagnosticsConfiguration.GetConfigSection()
在 System.Diagnostics.DiagnosticsConfiguration.Initialize()
在 System.Diagnostics.DiagnosticsConfiguration.get_SwitchSettings()
在 System.Diagnostics.Switch.InitializeConfigSettings()
在 System.Diagnostics.Switch.InitializeWithStatus()
在 System.Diagnostics.Switch.get_SwitchSetting()
在 System.Diagnostics.TraceSwitch.get_Level()
在 System.Data.ProviderBase.DbConnectionPoolCounters..ctor(String categoryName, String categoryHelp)
在 System.Data.SqlClient.SqlPerformanceCounters..ctor()
在 System.Data.SqlClient.SqlPerformanceCounters..cctor()
--- 内部异常堆栈跟踪的结尾 ---
在 System.Data.SqlClient.SqlConnectionFactory..cctor()
--- 内部异常堆栈跟踪的结尾 ---
在 System.Data.SqlClient.SqlConnection..cctor()
--- 内部异常堆栈跟踪的结尾 ---
在 System.Data.SqlClient.SqlConnection..ctor()
在 System.Data.SqlClient.SqlConnection..ctor(String connectionString)
在 BLL.BLLOrder.GetBookingSet(EntityLOrder obj, Int32 GoodsID) 位置 D:\Item\C#操作XML\EncryptConfig\BLL\BLLOrder.cs:行号 21
我是把这个项目.exe.config给加密后,在运行程序时解密连接数据库(注:只是程序解密,并没用覆盖原文件),如果覆盖原配置文件,程序是没有问题的,但是如果不覆盖则出现这种问题,请高手说说这个问题是怎么回事,应该怎么改?