From 43378c4f7f7ebfdd1c24199a97a574b034beaf69 Mon Sep 17 00:00:00 2001 From: ArsenShnurkov Date: Fri, 2 Jun 2017 10:22:48 +0300 Subject: [PATCH] fix copy-paste error --- mpt-core/04_CSProj/ProjectTools.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mpt-core/04_CSProj/ProjectTools.cs b/mpt-core/04_CSProj/ProjectTools.cs index dd0b43e..d3a40eb 100644 --- a/mpt-core/04_CSProj/ProjectTools.cs +++ b/mpt-core/04_CSProj/ProjectTools.cs @@ -307,7 +307,12 @@ public static bool RemoveReference(string csproj_file, string reference_name) { var stream = new MemoryStream(File.ReadAllBytes(csproj_file)); // cache file in memoty var document = XDocument.Load(stream); - return RemoveReference(document, reference_name); + bool bWasRemoved = RemoveReference(document, reference_name); + if (bWasRemoved) + { + document.Save(csproj_file); + } + return bWasRemoved; } public static void ReplaceReference(string csproj_file, string reference_name, bool force) @@ -315,7 +320,7 @@ public static void ReplaceReference(string csproj_file, string reference_name, b var stream = new MemoryStream(File.ReadAllBytes(csproj_file)); // cache file in memoty var document = XDocument.Load(stream); - bool bWasRemoved = RemoveReference(csproj_file, reference_name); + bool bWasRemoved = RemoveReference(document, reference_name); bool bRequiresSave = bWasRemoved; var xmlNamespaceManager = new XmlNamespaceManager(new NameTable());