{"record":{"id":"66d68871fa723b65","repo":"dotnet/wpf","slug":"sr-assembly0notfound-formatted-with-assemblyname","errorCode":null,"errorMessage":"SR.Assembly0NotFound (formatted with assemblyName)","messagePattern":"SR\\.Assembly0NotFound \\(formatted with assemblyName\\)","errorType":"exception","errorClass":"ProxyAssemblyNotLoadedException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/ProxyManager.cs","lineNumber":57,"sourceCode":"        //  Internal Methods\n        //\n        //------------------------------------------------------\n \n        #region Internal Methods\n\n        #region Proxy registration and table management\n\n        // load proxies from specified assembly\n        internal static void RegisterProxyAssembly ( AssemblyName assemblyName )\n        {\n            Assembly a = null;\n            try\n            {\n                a = Assembly.Load( assemblyName );\n            }\n            catch(System.IO.FileNotFoundException)\n            {\n                throw new ProxyAssemblyNotLoadedException(SR.Format(SR.Assembly0NotFound,assemblyName));\n            } \n            \n            string typeName = assemblyName.Name + \".UIAutomationClientSideProviders\";\n            Type t = a.GetType( typeName );\n            if( t == null )\n            {\n                throw new ProxyAssemblyNotLoadedException(SR.Format(SR.CouldNotFindType0InAssembly1, typeName, assemblyName));\n            }\n\n            FieldInfo fi = t.GetField(\"ClientSideProviderDescriptionTable\", BindingFlags.Static | BindingFlags.Public);\n            if (fi == null || fi.FieldType !=  typeof(ClientSideProviderDescription[]))\n            {\n                throw new ProxyAssemblyNotLoadedException(SR.Format(SR.CouldNotFindRegisterMethodOnType0InAssembly1, typeName, assemblyName));\n            }\n\n            ClientSideProviderDescription[] table = fi.GetValue(null) as ClientSideProviderDescription[];\n            if (table != null)\n            {","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/ProxyManager.cs#L39-L75","documentation":"RegisterProxyAssembly loads a proxy provider assembly via Assembly.Load(assemblyName); on FileNotFoundException it rethrows ProxyAssemblyNotLoadedException with SR.Assembly0NotFound formatted with the assembly name. It indicates the client-side UIA proxy assembly could not be located or loaded.","triggerScenarios":"Calling ClientSettings.RegisterClientSideProviders / LoadDefaultProxies path (proxy registration) with an AssemblyName whose DLL is not on the probe path (application directory, GAC, or probing paths).","commonSituations":"Custom UIA proxy assemblies not deployed next to the app, misnamed assembly (name/version/publicKeyToken mismatch), or missing dependency of the proxy assembly.","solutions":["Ensure the proxy assembly exists at the expected probe location and the AssemblyName (name, version, culture, publicKeyToken) matches exactly.","Add the assembly's directory to the application's probing path (App.config probing/privatePath or AppDomain.AssemblyResolve handler).","Verify the assembly's dependencies are also deployed and loadable.","Confirm the assembly targets a compatible CLR version and is loadable in-process (32/64-bit match)."],"exampleFix":"// before\nClientSettings.RegisterClientSideProviders(...); // assembly 'MyProxies' not found\n// after\nAppDomain.CurrentDomain.AssemblyResolve += (s, e) =>\n    e.Name.StartsWith(\"MyProxies\") ? Assembly.LoadFrom(@\"C:\\app\\MyProxies.dll\") : null;","handlingStrategy":"validation","validationCode":"var path = @\"C:\\app\\MyProxies.dll\";\nif (!System.IO.File.Exists(path)) throw new FileNotFoundException(\"Proxy assembly missing\", path);","typeGuard":"static bool CanLoadAssembly(AssemblyName name) => AppDomain.CurrentDomain.GetAssemblies().Any(a => a.GetName().FullName == name.FullName);","tryCatchPattern":"try { ClientSettings.RegisterClientSideProviders(table); }\ncatch (ProxyAssemblyNotLoadedException ex) { log.Error($\"Proxy assembly failed to load: {ex.Message}\"); }","preventionTips":["Deploy proxy assemblies next to the executable or hook AssemblyResolve.","Verify AssemblyName fields (version, publicKeyToken) exactly match the built DLL.","Test proxy assembly loading in the target architecture (x86/x64) before release."],"tags":["uiautomation","assembly-loading","proxy"],"backgroundTag":"file-not-found","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}