diff --git a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/Modules/DbgLoadModuleReferenceHandlerImpl.cs b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/Modules/DbgLoadModuleReferenceHandlerImpl.cs index ff1f090325..c704d7ee1b 100644 --- a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/Modules/DbgLoadModuleReferenceHandlerImpl.cs +++ b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/Modules/DbgLoadModuleReferenceHandlerImpl.cs @@ -63,8 +63,11 @@ bool GoToCore(DbgLoadModuleReference moduleRef, ReadOnlyCollection optio loadOptions |= DbgLoadModuleOptions.ForceMemory; bool canShowMessageBox = true; var md = LoadModule(moduleRef.Module, loadOptions, ref canShowMessageBox); - if (md is null) + if (md is null) { + if (canShowMessageBox) + messageBoxService.Value.Show(dnSpy_Debugger_DotNet_Resources.FailedToObtainValidInMemoryMetadataForModule); return false; + } // The file could've been added lazily to the list so add a short delay before we select it bool newTab = options.Any(a => StringComparer.Ordinal.Equals(PredefinedReferenceNavigatorOptions.NewTab, a)); @@ -73,8 +76,10 @@ bool GoToCore(DbgLoadModuleReference moduleRef, ReadOnlyCollection optio } ModuleDef? LoadModule(DbgModule module, DbgLoadModuleOptions options, ref bool canShowMessageBox) { - if (!module.IsDotNetModule()) + if (!module.IsDotNetModule()) { + canShowMessageBox = false; return null; + } if (module.IsDynamic && !module.Runtime.IsClosed && module.Process.IsRunning) { if (canShowMessageBox) { diff --git a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/Properties/dnSpy.Debugger.DotNet.Resources.Designer.cs b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/Properties/dnSpy.Debugger.DotNet.Resources.Designer.cs index 5225540456..d5f37081dd 100644 --- a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/Properties/dnSpy.Debugger.DotNet.Resources.Designer.cs +++ b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/Properties/dnSpy.Debugger.DotNet.Resources.Designer.cs @@ -1,7 +1,6 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -132,6 +131,15 @@ public static string DecompilerGeneratedVariablesCanNotBeEvaluated { } } + /// + /// Looks up a localized string similar to Failed to obtain valid in-memory metadata for module!. + /// + public static string FailedToObtainValidInMemoryMetadataForModule { + get { + return ResourceManager.GetString("FailedToObtainValidInMemoryMetadataForModule", resourceCulture); + } + } + /// /// Looks up a localized string similar to IL offset {0}. /// diff --git a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/Properties/dnSpy.Debugger.DotNet.Resources.resx b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/Properties/dnSpy.Debugger.DotNet.Resources.resx index 57e689f1fa..074537d431 100644 --- a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/Properties/dnSpy.Debugger.DotNet.Resources.resx +++ b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet/Properties/dnSpy.Debugger.DotNet.Resources.resx @@ -1,17 +1,17 @@  - @@ -141,6 +141,9 @@ Decompiler generated variables can't be evaluated + + Failed to obtain valid in-memory metadata for module! + IL offset {0} @@ -186,4 +189,4 @@ Unknown variable or object ID - \ No newline at end of file +