@@ -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