{"record":{"id":"4eea8492d921357c","repo":"pardeike/Harmony","slug":"unsupported-callsite-element-etype","errorCode":null,"errorMessage":"Unsupported callsite element: {etype}","messagePattern":"Unsupported callsite element: (.+?)","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"Harmony/Internal/InlineSignatureParser.cs","lineNumber":254,"sourceCode":"\t\t\t\t\t\treturn typeof(uint);\r\n\r\n\t\t\t\t\tcase MetadataType.Int64:\r\n\t\t\t\t\t\treturn typeof(long);\r\n\r\n\t\t\t\t\tcase MetadataType.UInt64:\r\n\t\t\t\t\t\treturn typeof(ulong);\r\n\r\n\t\t\t\t\tcase MetadataType.Single:\r\n\t\t\t\t\t\treturn typeof(float);\r\n\r\n\t\t\t\t\tcase MetadataType.Double:\r\n\t\t\t\t\t\treturn typeof(double);\r\n\r\n\t\t\t\t\tcase MetadataType.String:\r\n\t\t\t\t\t\treturn typeof(string);\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tthrow new NotSupportedException($\"Unsupported callsite element: {etype}\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n}\r\n","sourceCodeStart":236,"sourceCodeEnd":261,"githubUrl":"https://github.com/pardeike/Harmony/blob/e7872dc17008bc0ca2b3de1f53fd4120dbd7a17c/Harmony/Internal/InlineSignatureParser.cs#L236-L261","documentation":"InlineSignatureParser.ImportCallSite decodes callsite signature element types; the default branch of its element-type switch throws NotSupportedException for any MetadataType it does not explicitly handle, meaning the callsite uses an element kind the parser does not support.","triggerScenarios":"ImportCallSite reading an element type not covered by its cases (primitives, string, etc.) — e.g. MODIFIER (CMOD_OPT/CMOD_REQD), SENTINEL, typed references, or other exotic metadata element types in the callsite blob.","commonSituations":"Signatures containing custom modifiers (modreq/modopt) or vararg sentinels; hand-written IL with rarely used element types; assemblies produced by unusual compilers or IL rewriters.","solutions":["Remove custom modifiers or exotic element types from the callsite signature you are trying to import","Emit the signature against a simplified equivalent type without modreq/modopt","Upgrade Harmony — the parser's supported element set grows across versions","Manually decode the signature blob to identify the unsupported element type and work around it with a wrapper method"],"exampleFix":"// before\nimporting callsite whose param has modreq(IsVolatile)\n// after\ncall the method directly or via a delegate with a plain (unmodified) signature","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { var callSite = parser.ImportCallSite(module); }\ncatch (NotSupportedException ex) when (ex.Message.StartsWith(\"Unsupported callsite element\")) { /* strip exotic element types or use a wrapper */ }","preventionTips":["Keep callsite signatures limited to primitives, object, and string element types","Avoid custom modifiers (modreq/modopt) and sentinels in emitted signatures","Keep Harmony updated as the parser supports more element types over time"],"tags":["signatures","il-parsing","unsupported-type","harmony"],"backgroundTag":"unsupported-operation","analyzedSha":"e7872dc17008bc0ca2b3de1f53fd4120dbd7a17c","analyzedAt":"2026-09-15T22:47:11.550Z","contentChangedAt":"2026-09-15T22:47:11.550Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}