From 5723a660f79655c77682456205ea95d7f6407b17 Mon Sep 17 00:00:00 2001 From: Todd Grunke Date: Fri, 26 Jan 2018 05:58:41 -0800 Subject: Get rid of some exceptions that occur during project open (#3737) * Get rid of some exceptions that occur during project open * Revert removal of exception due to Process.GetProcessById call as the fix was a little bit slower. --- .../MonoDevelop.Projects.MSBuild/RemoteBuildEngineManager.cs | 10 +++++----- .../MonoDevelop.Projects.MSBuild/SdkResolution.cs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'main/src/core/MonoDevelop.Core') diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteBuildEngineManager.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteBuildEngineManager.cs index ea8f0b4273..c9373afb86 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteBuildEngineManager.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteBuildEngineManager.cs @@ -1,4 +1,4 @@ -// +// // RemoteBuildEngineManager.cs // // Author: @@ -609,12 +609,12 @@ namespace MonoDevelop.Projects.MSBuild spid = spid.Substring (0, i); int pid; if (int.TryParse (Path.GetFileName (spid), out pid)) { - try { - // If there is a process running with this id it means the builder is still being used - if (Process.GetProcessById (pid) != null) + try { + // If there is a process running with this id it means the builder is still being used + if (Process.GetProcessById (pid) != null) continue; } catch { - // Ignore + // Ignore } // No process for this id, it should be safe to delete the folder try { diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SdkResolution.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SdkResolution.cs index 46768a95f0..6b0b36c660 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SdkResolution.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SdkResolution.cs @@ -115,7 +115,7 @@ namespace MonoDevelop.Projects.MSBuild resolvers.AddRange (assembly.ExportedTypes .Select (type => new { type, info = type.GetTypeInfo () }) - .Where (t => t.info.IsClass && t.info.IsPublic && typeof (SdkResolver).IsAssignableFrom (t.type)) + .Where (t => t.info.IsClass && t.info.IsPublic && !t.info.IsAbstract && typeof (SdkResolver).IsAssignableFrom (t.type)) .Select (t => (SdkResolver)Activator.CreateInstance (t.type))); } catch (Exception e) { logger.LogWarning (e.Message); -- cgit v1.2.3