{"record":{"id":"9274bc953f4972ae","repo":"stride3d/stride","slug":"missing-mscorlib-dll-from-assembly","errorCode":null,"errorMessage":"Missing mscorlib.dll from assembly","messagePattern":"Missing mscorlib\\.dll from assembly","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.AssemblyProcessor/ParameterKeyProcessor.cs","lineNumber":21,"sourceCode":"\nusing System.Runtime.CompilerServices;\nusing Mono.Cecil;\nusing Mono.Cecil.Cil;\nusing Mono.Cecil.Rocks;\nusing MethodAttributes = Mono.Cecil.MethodAttributes;\n\nnamespace Stride.Core.AssemblyProcessor;\n\ninternal class ParameterKeyProcessor : IAssemblyDefinitionProcessor\n{\n    public bool Process(AssemblyProcessorContext context)\n    {\n        var assembly = context.Assembly;\n        var fields = new List<FieldDefinition>();\n\n        var mscorlibAssembly = CecilExtensions.FindCorlibAssembly(assembly);\n        if (mscorlibAssembly == null)\n            throw new InvalidOperationException(\"Missing mscorlib.dll from assembly\");\n\n        MethodDefinition parameterKeysMergeMethod = null;\n        TypeDefinition assemblyEffectKeysAttributeType = null;\n        var getTypeFromHandleMethod = new Lazy<MethodReference>(() =>\n        {\n            // Find Type.GetTypeFromHandle\n            var typeType = mscorlibAssembly.MainModule.GetTypeResolved(typeof(Type).FullName);\n            return assembly.MainModule.ImportReference(typeType.Methods.First(x => x.Name == \"GetTypeFromHandle\"));\n        });\n\n        var effectKeysStaticConstructors = new List<MethodReference>();\n        var effectKeysArrayElemementTypes = new HashSet<TypeReference>();\n\n        foreach (var type in assembly.MainModule.GetTypes())\n        {\n            fields.Clear();\n\n            foreach (var field in type.Fields.Where(x => x.IsStatic))","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.AssemblyProcessor/ParameterKeyProcessor.cs#L3-L39","documentation":"ParameterKeyProcessor.Process locates the coroutine/mscorlib assembly via FindCorlibAssembly and throws this InvalidOperationException if it cannot be found; the processor needs core types (Type, object, attribute constructors) from the corlib to generate parameter-key merge methods.","triggerScenarios":"Running AssemblyProcessor on an assembly whose referenced corlib cannot be resolved by FindCorlibAssembly (missing or non-standard mscorlib/System.Private.CoreLib reference).","commonSituations":"Processing assemblies compiled against unusual targets or trimmed AOT profiles lacking a corlib reference; referencing wrong framework (e.g. netstandard facade issues); corrupted build outputs missing assembly references.","solutions":["Ensure the processed project targets a supported framework and references the proper runtime (mscorlib/System.Private.CoreLib)","Clean and rebuild the solution so assembly references are complete","Verify AssemblyProcessor setup (Stride targets/props) so the assembly is compiled with normal SDK references","Avoid processing assemblies manually stripped of framework references"],"exampleFix":"// before (csproj)\n<TargetFramework>netstandard1.1</TargetFramework>\n// after\n<TargetFramework>net8.0</TargetFramework> <!-- standard framework with corlib reference -->","handlingStrategy":"validation","validationCode":"var corlib = CecilExtensions.FindCorlibAssembly(assembly);\nif (corlib == null) throw new InvalidOperationException(\"Assembly lacks a corlib reference; cannot process\");","typeGuard":null,"tryCatchPattern":"catch (InvalidOperationException ex) when (ex.Message == \"Missing mscorlib.dll from assembly\")\n{\n    // fix target framework / rebuild with standard SDK references\n}","preventionTips":["Target supported frameworks (net8.0 etc.) for processed assemblies","Don't strip framework references before AssemblyProcessor runs","Keep Stride build targets/props intact"],"tags":["il-weaving","assemblyprocessor","build","mscorlib"],"backgroundTag":"missing-dependency","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}