@@ -48,6 +48,7 @@ public class WixProjectNode : ProjectNode
48
48
private WixPackage package ;
49
49
private bool showAllFilesEnabled ;
50
50
51
+ private MSBuild . ProjectCollection userBuildProjectCollection ;
51
52
private MSBuild . Project userBuildProject ;
52
53
53
54
// =========================================================================================
@@ -342,16 +343,16 @@ public void CreateUserBuildProject()
342
343
{
343
344
if ( File . Exists ( this . UserFileName ) )
344
345
{
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.
347
348
// If loaded directly from the file, Visual Studio will display
348
349
// a save changes dialog if any changes are made to the user
349
350
// project since it will have been added to the global project
350
351
// collection. Loading from an XmlReader will prevent the
351
352
// project from being added to the global project collection
352
353
// 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 ) ;
355
356
}
356
357
else
357
358
{
0 commit comments