Skip to content

Commit

Permalink
Merge zdavidsen/user-import to close #20
Browse files Browse the repository at this point in the history
  • Loading branch information
robmen committed Dec 26, 2021
2 parents 36aaa15 + 9b8aceb commit 5ebf6ad
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/votive.shared/WixProjectNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class WixProjectNode : ProjectNode
private WixPackage package;
private bool showAllFilesEnabled;

private MSBuild.ProjectCollection userBuildProjectCollection;
private MSBuild.Project userBuildProject;

// =========================================================================================
Expand Down Expand Up @@ -342,16 +343,16 @@ public void CreateUserBuildProject()
{
if (File.Exists(this.UserFileName))
{
// Create the project from an XmlReader so that this file is
// not checked for being dirty when closing the project.
// Create the project in a new project collection so that this
// file is not checked for being dirty when closing the project.
// If loaded directly from the file, Visual Studio will display
// a save changes dialog if any changes are made to the user
// project since it will have been added to the global project
// collection. Loading from an XmlReader will prevent the
// project from being added to the global project collection
// and thus prevent the save changes dialog on close.
System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(this.UserFileName);
this.userBuildProject = new MSBuild.Project(xmlReader);
this.userBuildProjectCollection = new MSBuild.ProjectCollection(this.BuildProject.GlobalProperties);
this.userBuildProject = new MSBuild.Project(this.UserFileName, this.BuildProject.GlobalProperties, this.BuildProject.ToolsVersion, this.userBuildProjectCollection);
}
else
{
Expand Down

0 comments on commit 5ebf6ad

Please sign in to comment.