{"record":{"id":"6a12fb76583c0cc4","repo":"dotnet/wpf","slug":"new-proxyassemblynotloadedexception-description","errorCode":null,"errorMessage":"new ProxyAssemblyNotLoadedException(description)","messagePattern":"new ProxyAssemblyNotLoadedException\\(description\\)","errorType":"exception","errorClass":"ProxyAssemblyNotLoadedException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/UiaCoreApi.cs","lineNumber":1197,"sourceCode":"            || hr == UIA_E_PROXYASSEMBLYNOTLOADED)\n            {\n                string description;\n                if (!UiaGetErrorDescription(out description))\n                    description = SR.UnknownCoreAPIError;\n\n                switch (hr)\n                {\n                    case UIA_E_ELEMENTNOTENABLED:\n                        throw new ElementNotEnabledException(description);\n\n                    case UIA_E_ELEMENTNOTAVAILABLE:\n                        throw new ElementNotAvailableException(description);\n\n                    case UIA_E_NOCLICKABLEPOINT:\n                        throw new NoClickablePointException(description);\n\n                    case UIA_E_PROXYASSEMBLYNOTLOADED:\n                        throw new ProxyAssemblyNotLoadedException(description);\n                }\n            }\n\n            // Not a UIA-specific exception - let COM Interop handle the rest.\n            // (Marshal.ThrowExceptionForHR automatically calls GetErrorInfo to fill in the description\n            // field - UIA sets the error info itself, so it will get propogated here.)\n            Marshal.ThrowExceptionForHR(hr);\n        }\n\n        #endregion Private Methods\n\n        #region Raw API methods\n\n        //\n        // Client-side methods...\n        //\n\n        [DllImport(DllImport.UIAutomationCore, EntryPoint = \"UiaGetPropertyValue\", CharSet = CharSet.Unicode)]","sourceCodeStart":1179,"sourceCodeEnd":1215,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/UiaCoreApi.cs#L1179-L1215","documentation":"UiaCoreApi throws ProxyAssemblyNotLoadedException when the native core returns UIA_E_PROXYASSEMBLYNOTLOADED, indicating a UIA proxy (provider-side) assembly could not be loaded for a legacy/custom control. The error description is obtained from UiaGetErrorDescription. This typically signals a provider/proxy registration problem, not a client logic bug.","triggerScenarios":"Any wrapped native UIA call whose HRESULT is UIA_E_PROXYASSEMBLYNOTLOADED (0x80040203), usually when UIA attempts to use a Win32 proxy for a non-UIA control and the proxy assembly (UIAutomationClient-side proxies) fails to load.","commonSituations":"Automating legacy Win32/custom controls whose proxy registration is broken; corrupted or partially installed .NET/Windows SDK proxy assemblies; x86/x64 mismatch where the proxy assembly cannot be loaded into the process.","solutions":["Verify the target control's UIA proxy registration and that the UIA proxy assemblies (e.g. UIAutomationCore proxy components) are intact; repair the .NET Framework/SDK install","Check bitness: run the client process with the same architecture the proxies are registered for","If you own the control, implement a proper UIA provider instead of relying on proxies","Catch ProxyAssemblyNotLoadedException and degrade gracefully or surface a clear diagnostic to the user"],"exampleFix":"// before\nvar item = listElement.FindFirst(...); // may throw ProxyAssemblyNotLoadedException\n// after\ntry { var item = listElement.FindFirst(...); }\ncatch (ProxyAssemblyNotLoadedException ex)\n{\n    log.Error($\"UIA proxy not loaded: {ex.Message}\");\n    RepairProxyRegistration();\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { /* UIA operation */ }\ncatch (ProxyAssemblyNotLoadedException ex) { log.Error(ex.Message); RepairProxyRegistration(); }","preventionTips":["Verify proxy/provider registration for legacy controls","Match process bitness to registered proxies","Implement real UIA providers for custom controls instead of relying on proxies"],"tags":["uiautomation","wpf","proxy-assembly"],"backgroundTag":"module-init-failed","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-22T01:17:13.364Z"}