Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Commit 5ebf6ad

Browse files
committed
Merge zdavidsen/user-import to close #20
2 parents 36aaa15 + 9b8aceb commit 5ebf6ad

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/votive.shared/WixProjectNode.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public class WixProjectNode : ProjectNode
4848
private WixPackage package;
4949
private bool showAllFilesEnabled;
5050

51+
private MSBuild.ProjectCollection userBuildProjectCollection;
5152
private MSBuild.Project userBuildProject;
5253

5354
// =========================================================================================
@@ -342,16 +343,16 @@ public void CreateUserBuildProject()
342343
{
343344
if (File.Exists(this.UserFileName))
344345
{
345-
// Create the project from an XmlReader so that this file is
346-
// not checked for being dirty when closing the project.
346+
// Create the project in a new project collection so that this
347+
// file is not checked for being dirty when closing the project.
347348
// If loaded directly from the file, Visual Studio will display
348349
// a save changes dialog if any changes are made to the user
349350
// project since it will have been added to the global project
350351
// collection. Loading from an XmlReader will prevent the
351352
// project from being added to the global project collection
352353
// and thus prevent the save changes dialog on close.
353-
System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(this.UserFileName);
354-
this.userBuildProject = new MSBuild.Project(xmlReader);
354+
this.userBuildProjectCollection = new MSBuild.ProjectCollection(this.BuildProject.GlobalProperties);
355+
this.userBuildProject = new MSBuild.Project(this.UserFileName, this.BuildProject.GlobalProperties, this.BuildProject.ToolsVersion, this.userBuildProjectCollection);
355356
}
356357
else
357358
{

0 commit comments

Comments
 (0)