diff --git a/ILSpy/AssemblyTree/AssemblyTreeModel.cs b/ILSpy/AssemblyTree/AssemblyTreeModel.cs index 0d22f9b28..c2de7768e 100644 --- a/ILSpy/AssemblyTree/AssemblyTreeModel.cs +++ b/ILSpy/AssemblyTree/AssemblyTreeModel.cs @@ -946,12 +946,31 @@ namespace ICSharpCode.ILSpy.AssemblyTree } private void RefreshInternal() + { + _ = RefreshInternalAsync(); + } + + private async Task RefreshInternalAsync() { using (Keyboard.FocusedElement.PreserveFocus()) { var path = GetPathForNode(SelectedItem); ShowAssemblyList(settingsService.AssemblyListManager.LoadList(AssemblyList.ListName)); + + // Ensure assembly loaded before FindNodeByPath to allow lazy-loaded resource nodes to be found + if (path?.Length > 0) + { + foreach (var asm in AssemblyList.GetAssemblies()) + { + if (asm.FileName == path[0]) + { + await asm.GetMetadataFileAsync().Catch(_ => { }); + break; + } + } + } + SelectNode(FindNodeByPath(path, true), inNewTabPage: false); RefreshDecompiledView();