{"record":{"id":"c511145c8fdb59ac","repo":"JeffreySu/WeiXinMPSDK","slug":"finance-exportname","errorCode":null,"errorMessage":"企业微信 Finance 原生库缺少导出函数：{exportName}。","messagePattern":"企业微信 Finance 原生库缺少导出函数：(.+?)。","errorType":"exception","errorClass":"EntryPointNotFoundException","httpStatus":null,"severity":"critical","filePath":"src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/MsgAudit/MsgAuditFinanceNativeApi.cs","lineNumber":410,"sourceCode":"        /// <returns>绑定到导出函数的托管委托。</returns>\n        public TDelegate GetDelegate<TDelegate>(string exportName) where TDelegate : Delegate\n        {\n            ThrowIfDisposed();\n            IntPtr symbol;\n            if (_isWindows)\n            {\n                symbol = WindowsNative.GetProcAddress(_handle, exportName);\n            }\n            else\n            {\n                symbol = _useLegacyLibDl\n                    ? LinuxLegacyNative.DlSym(_handle, exportName)\n                    : LinuxNative.DlSym(_handle, exportName);\n            }\n\n            if (symbol == IntPtr.Zero)\n            {\n                throw new EntryPointNotFoundException(\n                    $\"企业微信 Finance 原生库缺少导出函数：{exportName}。\");\n            }\n\n            return Marshal.GetDelegateForFunctionPointer<TDelegate>(symbol);\n        }\n\n        /// <summary>\n        /// 释放动态库句柄。\n        /// </summary>\n        public void Dispose()\n        {\n            var handle = _handle;\n            if (handle == IntPtr.Zero)\n            {\n                return;\n            }\n\n            _handle = IntPtr.Zero;","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/JeffreySu/WeiXinMPSDK/blob/be573f6f94bdbf718dd5f6cdecb137fbc7ff651e/src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/MsgAudit/MsgAuditFinanceNativeApi.cs#L392-L428","documentation":"The native library loaded, but GetProcAddress/dlsym could not find the required exported function (exportName) in the WeChat Work Finance SDK. The wrapper throws EntryPointNotFoundException. This means the file at the path is not the expected Finance SDK binary, or it is a different/incompatible version that lacks the C ABI export.","triggerScenarios":"LibraryPath points to a wrong file (e.g. the C# wrapper dll instead of the SDK dll, or an unrelated dll with the same name); using an old SDK version missing a newer export such as GetMediaData; a partially downloaded/corrupted SDK file.","commonSituations":"Upgrading Senparc.Weixin.Work while keeping an old WeWorkFinanceSdk binary; renaming the SDK file manually so the wrong dll is picked up from the search path; NuGet/runtime pack shipping a stub.","solutions":["Verify you downloaded the official WeWorkFinanceSdk of the matching version and point LibraryPath directly at it.","Check exports with dumpbin /exports (Windows) or nm -D (Linux) to confirm exportName exists.","Replace the file if it is corrupted or a same-named different library; do not rely on bare-name search order.","Update the SDK binary to the newest version when a newly added wrapper API calls a new export."],"exampleFix":"// before\nvar api = MsgAuditFinanceNativeApi.Create(\"bin/libWeWorkFinanceSdk_Csharp.dll\"); // wrong file, no exports\n// after\nvar api = MsgAuditFinanceNativeApi.Create(@\"libs\\WeWorkFinanceSdk\\libWeWorkFinanceSdk.dll\"); // official SDK dll","handlingStrategy":"fallback","validationCode":"// verify exports before wiring the API (Linux)\nvar output = Process.Start(new ProcessStartInfo(\"nm\", $\"-D {path}\")) // ensure expected export exists in output","typeGuard":"static bool HasExpectedExports(string path, params string[] exports) => /* dumpbin/nm output contains all export names */ true;","tryCatchPattern":"try { return library.GetDelegate<TDelegate>(name); }\ncatch (EntryPointNotFoundException ex) { throw new InvalidOperationException($\"{path} is not the official WeWorkFinanceSdk or is an old version (missing {name})\", ex); }","preventionTips":["Download the official SDK from Tencent and version-pin it next to the app.","After SDK upgrades, redeploy the matching native binary together with the NuGet update.","Inspect exports (dumpbin /exports, nm -D) when the deployment is in doubt."],"tags":["native-library","entrypoint","version-mismatch"],"backgroundTag":"missing-dependency","analyzedSha":"be573f6f94bdbf718dd5f6cdecb137fbc7ff651e","analyzedAt":"2026-09-12T10:01:50.733Z","contentChangedAt":"2026-09-12T10:01:50.733Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}