diff --git a/src/AddIns/Debugger/Debugger.AddIn/Service/AttachToProcessForm.cs b/src/AddIns/Debugger/Debugger.AddIn/Service/AttachToProcessForm.cs index e3507a5ec8..31008d034a 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Service/AttachToProcessForm.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Service/AttachToProcessForm.cs @@ -25,10 +25,9 @@ namespace ICSharpCode.SharpDevelop.Services { this.process = process; try { - var modules = process.Modules.Cast().Where( - m => m.ModuleName.StartsWith("mscor", StringComparison.InvariantCultureIgnoreCase)); - - managed = modules.Count() > 0; + managed = process.Modules + .OfType() + .Any(m => m.ModuleName.StartsWith("mscor", StringComparison.InvariantCultureIgnoreCase)); } catch { } string fileName = Path.GetFileName(process.MainModule.FileName);