{"record":{"id":"10d1ea39959fbdb2","repo":"k1tbyte/Wand-Enhancer","slug":"enhancer-proxy-dll-resource-not-found","errorCode":null,"errorMessage":"[ENHANCER] Proxy DLL resource not found","messagePattern":"\\[ENHANCER\\] Proxy DLL resource not found","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"critical","filePath":"WandEnhancer/Core/Enhancer.cs","lineNumber":427,"sourceCode":"                : 0;\n            if (defaultScriptCount == 0)\n            {\n                throw new FileNotFoundException(\"[ENHANCER] Remote renderer script artifacts are missing. Run `cd web-panel && pnpm run build` before patching.\", targetScriptsRoot);\n            }\n\n            int selectedScriptCount = CopySelectedJavaScriptFiles(_config.CustomScriptPaths, targetScriptsRoot);\n            int localScriptCount = CopyJavaScriptFiles(localCustomScriptsRoot, targetScriptsRoot);\n\n            _logger($\"[ENHANCER] Injected remote panel assets and renderer scripts into app.asar (default: {defaultScriptCount}, selected: {selectedScriptCount}, local: {localScriptCount})\", ELogType.Info);\n        }\n\n        private void AttachProxyDll()\n        {\n            var assembly = Assembly.GetExecutingAssembly();\n            var dll = assembly.GetManifestResourceStream(Constants.ProxyDllResouceName);\n            if (dll == null)\n            {\n                throw new Exception(\"[ENHANCER] Proxy DLL resource not found\");\n            }\n            var destPath = Path.Combine(_weModConfig.RootDirectory, \"version.dll\");\n            using (var fileStream = File.Create(destPath))\n            {\n                dll.CopyTo(fileStream);\n            }\n            _logger(\"[ENHANCER] Proxy DLL attached\", ELogType.Info);\n        }\n\n        public void Patch()\n        {\n            Common.TryKillProcess(_weModConfig.BrandName);\n            if (!File.Exists(_backupPath))\n            {\n                _logger(\"[ENHANCER] Creating backup...\", ELogType.Info);\n                File.Copy(_asarPath, _backupPath);\n            }\n            else","sourceCodeStart":409,"sourceCodeEnd":445,"githubUrl":"https://github.com/k1tbyte/Wand-Enhancer/blob/643c8f8b62cbb26fd3ac105b92497d9a9c445f08/WandEnhancer/Core/Enhancer.cs#L409-L445","documentation":"AttachProxyDll loads the embedded resource named 'proxydll' (Constants.ProxyDllResouceName) which is the version.dll proxy dropped into the WeMod root to load enhancer code into Wand. A null stream means the resource is not embedded in the assembly.","triggerScenarios":"AttachProxyDll() at Enhancer.cs:423-428 during Enhancer.Patch(): assembly.GetManifestResourceStream(\"proxydll\") returns null.","commonSituations":"The .csproj does not include proxydll as an EmbeddedResource (or lacks LogicalName 'proxydll'); the binary was renamed/removed from source; the build configuration excludes it; building from a fork that lacks the proxy DLL.","solutions":["Confirm the .csproj has an EmbeddedResource entry for the proxy DLL with LogicalName 'proxydll' (matching Constants.ProxyDllResouceName).","Ensure the proxydll binary exists at the expected source path.","Rebuild the solution.","Verify with a scratch probe: Assembly.GetExecutingAssembly().GetManifestResourceNames() must list 'proxydll'."],"exampleFix":"<!-- .csproj -->\n<!-- before: resource missing -->\n<!-- after: -->\n<ItemGroup>\n  <EmbeddedResource Include=\"proxydll\\version.dll\">\n    <LogicalName>proxydll</LogicalName>\n  </EmbeddedResource>\n</ItemGroup>","handlingStrategy":"validation","validationCode":"// Assert the proxy DLL is embedded before exposing the patch action\nbool hasProxy = Assembly.GetExecutingAssembly()\n    .GetManifestResourceStream(Constants.ProxyDllResouceName) != null;\nif (!hasProxy) throw new InvalidOperationException(\"proxydll resource not embedded; rebuild the C# project.\");","typeGuard":null,"tryCatchPattern":"try { enhancer.Patch(); }\ncatch (Exception ex) when (ex.Message == \"[ENHANCER] Proxy DLL resource not found\") {\n    // rebuild with the EmbeddedResource + LogicalName 'proxydll'\n}","preventionTips":["Add a unit test asserting GetManifestResourceStream(\"proxydll\") is non-null.","Keep the .csproj EmbeddedResource LogicalName aligned with Constants.ProxyDllResouceName.","Fail the build if the proxy DLL binary is missing from source."],"tags":["embedded-resources","build","proxy-dll"],"backgroundTag":null,"analyzedSha":"643c8f8b62cbb26fd3ac105b92497d9a9c445f08","analyzedAt":"2026-08-13T14:17:43.823Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}