AppDomain build load raises Fatal Execution Engine error (6B3979C6) (80131506)

We have a type caching system to avoid looking for all plugins for all types every time our application starts, but when moving from .NET 1.1 to 2.0+, Fatal Execution Engine Error (6B3979C6) (80131506) is written to the AppDomain in the event log .Load ()

If and only if 1. AppDomain is not AppDomain.CurrentDomain. 2. The assembly is not in the executable directory.

We allow users to provide their own builds in project-specific directories, so we cannot work with 2.

I believe 1. is required so that we can unload the AppDomain after skimming for types.

I am not the owner of this code, but I can ask the right questions if I have not provided sufficient information.

This code throws a fatal error:

    private static void AddAssembly( System.AppDomain appDom, Manifest manifest, string filenameWithoutExtension )
    {
        try
        {
            // Test that the assembly can be loaded...
            System.Reflection.Assembly.ReflectionOnlyLoad(filenameWithoutExtension);

            System.Reflection.Assembly assem = appDom.Load( filenameWithoutExtension );
            ArrayList attributes = new ArrayList();
            //  System.Reflection.Assembly assem = System.Reflection.Assembly.LoadFrom(path+"\\"+file.Name);
            object[] attribs = assem.GetCustomAttributes( typeof(PlugInAttribute), false );
            if ( attribs.Length > 0 )
            {
                attribs = assem.GetCustomAttributes( false );
                foreach ( Attribute attr in attribs )
                {
                    object[] attrAttrs = attr.GetType().GetCustomAttributes(typeof(PlugInAttribute), false );
                    if ( attrAttrs.Length > 0 ) 
                    {
                        attributes.Add(attr.GetType().ToString());
                        break;
                    }
                }
            }
            if ( attribs.Length > 0 || attributes.Count > 0 )
            {
                Assembly assy = new Assembly( manifest );
                manifest.Assemblies.Add(assy);
                assy.Name = filenameWithoutExtension;
                assy.Version = AssemblyName.GetAssemblyName( System.IO.Path.Combine( manifest.Path, filenameWithoutExtension + ".dll") ).Version.ToString();
                assy.Attributes = (ArrayList)attributes.Clone();
                System.Type[] types = assem.GetTypes();
                foreach (System.Type type in types )
                    if ( !type.IsNestedPrivate && !type.IsNestedPublic
                        && !type.IsNestedAssembly  )
                        assy.AddType( type );
            }
        }
        catch ( Exception ex )
        {
            System.Diagnostics.Trace.WriteLine( "Manifest.AddAssembly Exception: " + ex.Message );

            Manager.WriteException(ex);
        }
    }

      

0


a source to share


1 answer


This was caused by a third party licensing library that injected an error code into the process.



0


a source







All Articles