{"record":{"id":"0c58c01075e512b8","repo":"dotnet/maui","slug":"xc0124","errorCode":"XC0124","errorMessage":"Resource \"{0}\" not found.","messagePattern":"Resource \"(.+?)\" not found\\.","errorType":"error_code","errorClass":"BuildException","httpStatus":null,"severity":"error","filePath":"src/Controls/src/Build.Tasks/CompiledConverters/RDSourceTypeConverter.cs","lineNumber":39,"sourceCode":"\t\t\twhile (!(rootNode is ILRootNode))\n\t\t\t\trootNode = rootNode.Parent;\n\n\t\t\tvar rdNode = node.Parent as ElementNode;\n\n\t\t\tvar rootTargetPath = XamlCTask.GetPathForType(context.Cache, currentModule, ((ILRootNode)rootNode).TypeReference);\n\n\t\t\tvar module = currentModule;\n\t\t\tstring asmName = null;\n\t\t\tif (value.Contains(\";assembly=\"))\n\t\t\t{\n\t\t\t\tvar parts = value.Split([\";assembly=\"], StringSplitOptions.RemoveEmptyEntries);\n\t\t\t\tvalue = parts[0];\n\t\t\t\tasmName = parts[1];\n\t\t\t\tif (currentModule.Assembly.Name.Name != asmName)\n\t\t\t\t{\n\t\t\t\t\tvar ar = currentModule.AssemblyReferences.FirstOrDefault(ar => ar.Name == asmName);\n\t\t\t\t\tif (ar == null)\n\t\t\t\t\t\tthrow new BuildException(BuildExceptionCode.ResourceMissing, node, null, value);\n\t\t\t\t\tmodule = currentModule.AssemblyResolver.Resolve(ar).MainModule;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar uri = new Uri(value, UriKind.Relative);\n\n\t\t\tvar resourcePath = ResourceDictionary.RDSourceTypeConverter.GetResourcePath(uri, rootTargetPath);\n\n\t\t\tforeach (var instruction in CreateUri(context, (ILRootNode)rootNode, value, node, asmName))\n\t\t\t\tyield return instruction;\n\n\t\t\tvar uriVarDef = new VariableDefinition(currentModule.ImportReference(context.Cache, (\"System\", \"System\", \"Uri\")));\n\t\t\tbody.Variables.Add(uriVarDef);\n\t\t\tyield return Create(Stloc, uriVarDef);\n\n\t\t\tvar resourceTypeRef = GetTypeForPath(context.Cache, module, resourcePath);\n\t\t\tif (resourceTypeRef is not null)\n\t\t\t{\n\t\t\t\tforeach (var instruction in CreateResourceDictionaryType(context, currentModule, module, node, rdNode, resourceTypeRef, uriVarDef))","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/dotnet/maui/blob/f377ff1c5ee04d334d8a925f50c83a6b7afddf03/src/Controls/src/Build.Tasks/CompiledConverters/RDSourceTypeConverter.cs#L21-L57","documentation":"XC0124 ResourceMissing thrown by RDSourceTypeConverter when an assembly specified via the ';assembly=' suffix in a ResourceDictionary Source value is not found among the current module's assembly references. The converter looks up the assembly reference by name; if none matches, the build fails before even trying to locate the resource file.","triggerScenarios":"Using Source=\"Resources/Styles.xaml;assembly=MyApp.Shared\" on a ResourceDictionary where 'MyApp.Shared' is not referenced by the current project. A typo in the assembly name, or the referenced project has not been built/added as a project reference.","commonSituations":"Renaming a project/assembly without updating Source references. Referencing an assembly by its output DLL name rather than its assembly name. Forgetting to add a project reference to the assembly containing the resource. Case-sensitivity mismatches in the assembly name.","solutions":["Ensure the specified assembly name exactly matches an assembly reference in the current project's .csproj (ProjectReference or Reference).","Verify the assembly name by checking the .csproj <AssemblyName> or the DLL name — use the assembly name, not the file path.","Add a missing project or assembly reference, or correct typos in the ';assembly=' value.","If referencing a resource within the same assembly, omit the ';assembly=' suffix entirely."],"exampleFix":"<!-- before -->\n<ResourceDictionary Source=\"Resources/Styles.xaml;assembly=MyApp.Shard\" />\n\n<!-- after -->\n<ResourceDictionary Source=\"Resources/Styles.xaml;assembly=MyApp.Shared\" />","handlingStrategy":"validation","validationCode":"// Validate that an assembly referenced in a ResourceDictionary Source exists in the project\nstatic bool IsAssemblyReferenced(string assemblyName, IEnumerable<AssemblyName> referencedAssemblies)\n    => referencedAssemblies.Any(a => a.Name == assemblyName);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always add a project/assembly reference before using ';assembly=' in a ResourceDictionary Source.","Use the exact assembly name (from AssemblyName), not the DLL file path.","If the resource is in the same assembly, omit the ';assembly=' suffix."],"tags":["xaml","maui","xamlc","resourcedictionary","resource-missing","assembly-reference","build-time"],"backgroundTag":null,"analyzedSha":"f377ff1c5ee04d334d8a925f50c83a6b7afddf03","analyzedAt":"2026-08-13T14:26:18.069Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}