Skip to content

Commit

Permalink
Merge pull request #26 from ArsenShnurkov/external-project-issue
Browse files Browse the repository at this point in the history
fix copy-paste error
  • Loading branch information
ArsenShnurkov authored Jun 2, 2017
2 parents c5a6f4f + 43378c4 commit 98dfea6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mpt-core/04_CSProj/ProjectTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,20 @@ 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)
{
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());
Expand Down

0 comments on commit 98dfea6

Please sign in to comment.