System.Security.SecurityException the type initializer for ' System.Data.Entity.Internal.AppConfig ' threw an exception

Source: Internet
Author: User
Tags stack trace

[15/08/19 00:03:10] [Datamanager-7292-error] System.Reflection.TargetInvocationException:Exception have been thrown by the target of a invocation. ---> System.TypeInitializationException:The type initializer for ' System.Data.Entity.Internal.AppConfig ' threw an  exception. ---> System.Configuration.ConfigurationErrorsException:An error occurred creating the Configuration section handler For Entityframework:request failed.   (D:\LST\LenovoSmartToolSrv.exe.Config line 8)---> System.Security.SecurityException:Request failed. At System.RuntimeMethodHandle.PerformSecurityCheck (Object obj, runtimemethodhandleinternal method, RuntimeType Parent, UInt32 Invocationflags) at System.RuntimeMethodHandle.PerformSecurityCheck (Object obj, iruntimemethodinfo method, RuntimeType parent, UInt32 invocationflags) at System.Reflection.RuntimeConstructorInfo.Invoke (BindingFlags invokeattr, Binder binder, object[] parameters, CultureInfo culture) at System.Reflection.ConstructorInfo.Invoke(object[] parameters) at System.Configuration.TypeUtil.InvokeCtorWithReflectionPermission (ConstructorInfo ctor) at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.CreateSectionImpl ( Runtimeconfigurationrecord Configrecord, Factoryrecord Factoryrecord, Sectionrecord SectionRecord, Object Parentconfig, Configxmlreader Reader) at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.CreateSectionWithRestrictedPermissions (Runtimeconfigurationrecord Configrecord, Factoryrecord Factoryrecord, Sectionrecord SectionRecord, Object Parentconfig, Configxmlreader Reader) at System.Configuration.RuntimeConfigurationRecord.CreateSection (Boolean   inputistrusted, Factoryrecord Factoryrecord, Sectionrecord Sectionrecord, Object parentconfig, ConfigXmlReader Reader) At System.Configuration.BaseConfigurationRecord.CallCreateSection (Boolean inputistrusted, Factoryrecord Factoryrecord, Sectionrecord Sectionrecord, Object parentconfig, ConfigxmlreadeR Reader, String filename, Int32 line)---End of inner exception stack trace---at System.Configuration.BaseConfigur Ationrecord.evaluateone (string[] keys, sectioninput input, Boolean istrusted, Factoryrecord Factoryrecord, Sectionrecord Sectionrecord, Object parentresult) at System.Configuration.BaseConfigurationRecord.Evaluate ( Factoryrecord Factoryrecord, Sectionrecord Sectionrecord, Object parentresult, Boolean getlkg, Boolean getruntimeobject , object& result, object& resultruntimeobject) at System.Configuration.BaseConfigurationRecord.GetSectionRecursive (String Configkey, Boolean getlkg, Boolean   Checkpermission, Boolean Getruntimeobject, Boolean requestishere, object& result, object& resultruntimeobject) At System.Configuration.BaseConfigurationRecord.GetSectionRecursive (String Configkey, Boolean getlkg, Boolean   Checkpermission, Boolean Getruntimeobject, Boolean requestishere, object& result, object& resultruntimeobject) At System.Configuration.Baseconfigurationrecord.getsectionrecursive (String Configkey, Boolean getlkg, Boolean checkpermission, Boolean Getruntimeobject, Boolean requestishere, object& result, object& resultruntimeobject) at System.Configuration.BaseConfigurationRecord.GetSection (String Configkey) at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection ( String sectionname) at System.Configuration.ConfigurationManager.GetSection (string sectionname) at System.Data.Entity.Internal.AppConfig. ctor () at System.Data.Entity.Internal.AppConfig.  Cctor ()---End of inner exception stack trace---at System.Data.Entity.Internal.AppConfig.get_DefaultInstance () at System.Data.Entity.Internal.LazyInternalConnection. ctor (DbContext context, String nameorconnectionstring) at System.Data.Entity.DbContext.. ctor (String nameorconnectionstring) at dataaccessor.firebirddatamanger.<>c__displayclass76.< deletetechnicalandnotice>b__73 ()---End of inner exception stack trace---Server stack trace:at System.RuntimeTypeHandle.CreateInstance (runtimetype type , Boolean publiconly, Boolean NoCheck, boolean& canbecached, runtimemethodhandleinternal& ctor, boolean& Bneedsecuritycheck) at System.RuntimeType.CreateInstanceSlow (Boolean publiconly, Boolean Skipcheckthis, Boolean FillCache) at System.RuntimeType.CreateInstanceDefaultCtor (Boolean publiconly, Boolean Skipvisibilitychecks, Boolean Skipcheckthis, Boolean FillCache) at System.Activator.CreateInstance (type type, Boolean nonpublic) at System.Data.Enti Ty. UTILITIES.TYPEEXTENSIONS.CREATEINSTANCE[T] (type type, Func ' 2 exceptionfactory) at SYSTEM.DATA.ENTITY.UTILITIES.TYPEEXTENSIONS.CREATEINSTANCE[T] (type type, func ' 3 typemessagefactory, func ' 2 Exceptionfactory) at system.data.entity.infrastructure.dependencyresolution.dbconfigurationmanager.<.ctor> B__1 () at System.lazy ' 1.CreateValue () Exception rethrown @ [0]: at System.lazy ' 1.get_value ()  At System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationManager.GetConfiguration () at System.Data.Entity.Core.EntityClient.EntityConnection.ChangeConnectionString (String newconnectionstring) at System.Data.Entity.Core.EntityClient.EntityConnection. ctor (String connectionString) at System.Data.Entity.Core.Objects.ObjectContext.CreateEntityConnection (string connectionString) at Dataaccessor.firebirddataaccessorentities. ctor () at Dataaccessor.firebirddatamanger.<>c__displayclass28 ' 1.<select>b__27 ()

Today encountered a bug, through the site to reproduce, the source of this bug is the test manually replaced the configuration file, and the configuration file is transmitted through the SKYP, that is, through the network obtained (through the network is the key), at this time the configuration file security is "Block" state, under normal circumstances, This is not the case for direct installation,

Security check fails when frameworks reads app. Config

Manual "Unblock", client everything is running normally

When we found this bug, we were repeatedly tried to reproduce by many different operating system computers, and in the case of this bug the computer, 100% reproduce, so we agree that this and the operating system is currently set the security level of concern, as to whether this is the reason, we did not continue to verify, Because we already think it's not a bug.

System.Security.SecurityException the type initializer for ' System.Data.Entity.Internal.AppConfig ' threw an exception

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.