Entity Framework throws Catastrophic failure

0

Recently we are facing an issue with Entity Framework , We have a code which just insert s a record into a table using entity framework using DBContext.SaveChanges() . This is throwing an Exception

System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))    
at System.Security.Policy.PEFileEvidenceFactory.GetLocationEvidence(SafePEFileHandle peFile, SecurityZone& zone, StringHandleOnStack retUrl)    
at System.Security.Policy.PEFileEvidenceFactory.GenerateLocationEvidence()    at System.Security.Policy.PEFileEvidenceFactory.GenerateEvidence(Type evidenceType)    
at System.Security.Policy.AssemblyEvidenceFactory.GenerateEvidence(Type evidenceType)    
at System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type)    
at System.Security.Policy.Evidence.GetHostEvidence(Type type, Boolean markDelayEvaluatedEvidenceUsed)    
at System.Security.Policy.AppDomainEvidenceFactory.GenerateEvidence(Type evidenceType)    
at System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type)    
at System.Security.Policy.Evidence.RawEvidenceEnumerator.MoveNext()    
at System.Security.Policy.Evidence.EvidenceEnumerator.MoveNext()    
at System.Configuration.ClientConfigPaths.GetEvidenceInfo(AppDomain appDomain, String exePath, String& typeName)    
at System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(AppDomain appDomain, String exePath)    
at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)    
at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)    
at System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record)    
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.ConfigurationManager.GetSection(String sectionName)    
at System.Xml.XmlConfiguration.XmlReaderSection.get_ProhibitDefaultUrlResolver()    
at System.Xml.Schema.Parser..ctor(SchemaType schemaType, XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler)    
at System.Xml.Schema.XmlSchema.Read(XmlReader reader, ValidationEventHandler validationEventHandler)    
at System.Data.Entity.Core.SchemaObjectModel.Schema.SomSchemaSetHelper.AddXmlSchemaToSet(XmlSchemaSet schemaSet, XmlSchemaResource schemaResource, HashSet`1 schemasAlreadyAdded)    
at System.Data.Entity.Core.SchemaObjectModel.Schema.SomSchemaSetHelper.AddXmlSchemaToSet(XmlSchemaSet schemaSet, XmlSchemaResource schemaResource, HashSet`1 schemasAlreadyAdded)    
at System.Data.Entity.Core.SchemaObjectModel.Schema.SomSchemaSetHelper.ComputeSchemaSet(SchemaDataModelOption dataModel)    
at System.Data.Entity.Core.Common.Utils.Memoizer`2.Result.GetValue()    
at System.Data.Entity.Core.Common.Utils.Memoizer`2.Evaluate(TArg arg)    
at System.Data.Entity.Core.SchemaObjectModel.Schema.CreateXmlReaderSettings()    
at System.Data.Entity.Core.SchemaObjectModel.Schema.Parse(XmlReader sourceReader, String sourceLocation)    
at System.Data.Entity.Core.SchemaObjectModel.SchemaManager.ParseAndValidate(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths, SchemaDataModelOption dataModel, AttributeValueNotification providerNotification, AttributeValueNotification providerManifestTokenNotification, ProviderManifestNeeded providerManifestNeeded, IList`1& schemaCollection)    
at System.Data.Entity.Core.SchemaObjectModel.SchemaManager.ParseAndValidate(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths, SchemaDataModelOption dataModel, DbProviderManifest providerManifest, IList`1& schemaCollection)    
at System.Data.Entity.Core.Metadata.Edm.EdmItemCollection.LoadItems(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths, SchemaDataModelOption dataModelOption, DbProviderManifest providerManifest, ItemCollection itemCollection, Boolean throwOnError)    
at System.Data.Entity.Core.Metadata.Edm.EdmItemCollection.Init(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths, Boolean throwOnError)    
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.LoadEdmItemCollection(MetadataArtifactLoader loader)    
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.<>c__DisplayClass5.<GetMetadataWorkspace>b__0(String k)    
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)    
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.GetMetadataWorkspace(DbConnectionOptions effectiveConnectionOptions)    
at System.Data.Entity.Core.EntityClient.EntityConnection.GetMetadataWorkspace()    
at System.Data.Entity.Core.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor, ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory, Translator translator, ColumnMapFactory columnMapFactory)    
at System.Data.Entity.Internal.InternalConnection.CreateObjectContextFromConnectionModel()    
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()    
at System.Data.Entity.Internal.InternalContext.Initialize()    
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)    
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()    
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()    
at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()    
at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)

This exception is intermittent . I havent found anything in net which relates to this . Can someone help here on this?

.net
entity-framework
asked on Stack Overflow Mar 8, 2019 by Shiva Kesetty • edited Mar 8, 2019 by Felix

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0