diff options
Diffstat (limited to 'main/src')
4 files changed, 11 insertions, 6 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs index 7ef6e407c6..79315ca235 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs @@ -507,7 +507,7 @@ namespace MonoDevelop.Core public static void LogError (string message, Exception ex) { - LogUserError (message, ex); + Log (LogLevel.Error, message + (ex != null? Environment.NewLine + ex : string.Empty)); } [Obsolete ("Use LogError")] diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemTypeNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemTypeNode.cs index 37283b264d..5c00072556 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemTypeNode.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemTypeNode.cs @@ -109,6 +109,13 @@ namespace MonoDevelop.Projects.Extensions return await factory.CreateItem (fileName, typeGuid); } try { + // Some subclasses (such as ProjectTypeNode) need to assign some data to + // the object before it is initialized. However, by default initialization + // is automatically made by the constructor, so to support this scenario + // the initialization has to be delayed. This is done by setting the + // MonoDevelop.DelayItemInitialization logical context property. + // When this property is set, the object is not initialized, and it has + // to be manually initialized by calling EnsureInitialized. CallContext.LogicalSetData ("MonoDevelop.DelayItemInitialization", true); return (SolutionItem) Activator.CreateInstance (ItemType); } finally { diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/RemoteProjectBuilder.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/RemoteProjectBuilder.cs index be2c6002f8..d2cefb444b 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/RemoteProjectBuilder.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/RemoteProjectBuilder.cs @@ -57,7 +57,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild { try { return engine.LoadProject (projectFile); - } catch (Exception ex) { + } catch { CheckDisconnected (); throw; } @@ -78,7 +78,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild { try { engine.SetCulture (uiCulture); - } catch (Exception ex) { + } catch { CheckDisconnected (); throw; } @@ -88,7 +88,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild { try { engine.SetGlobalProperties (properties); - } catch (Exception ex) { + } catch { CheckDisconnected (); throw; } diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectReference.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectReference.cs index a30115c441..d24efcd308 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectReference.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectReference.cs @@ -76,7 +76,6 @@ namespace MonoDevelop.Projects string customError; FilePath hintPath; - string originalMSBuildReferenceInclude; string originalMSBuildReferenceHintPath; public event EventHandler StatusChanged; @@ -225,7 +224,6 @@ namespace MonoDevelop.Projects var hp = buildItem.Metadata.GetValue ("HintPath"); Init (ReferenceType.Assembly, hp, null); SetInvalid (GettextCatalog.GetString ("Invalid file path")); - originalMSBuildReferenceInclude = buildItem.Include; } else { var type = File.Exists (path) ? ReferenceType.Assembly : ReferenceType.Package; Init (type, buildItem.Include, path); |