@@ -621,6 +621,8 @@ task CreatePackages -depends PrepareRelease -description "After preparing for R
621
621
"
622
622
$installPs1Content = " param(`$ installPath, `$ toolsPath, `$ package, `$ project)
623
623
624
+ `$ project.Save()
625
+
624
626
`$ directoryName = [system.io.Path]::GetDirectoryName(`$ project.FullName)
625
627
`$ appConfigFile = `$ directoryName + `" \App.config`"
626
628
if((Test-Path -Path `$ appConfigFile) -eq `$ true){
@@ -643,46 +645,35 @@ task CreatePackages -depends PrepareRelease -description "After preparing for R
643
645
}
644
646
}
645
647
646
- if(`$ Host.Version.Major -gt 1)
647
- {
648
648
[xml] `$ prjXml = Get-Content `$ project.FullName
649
649
`$ proceed = `$ true
650
650
foreach(`$ PropertyGroup in `$ prjXml.project.ChildNodes)
651
651
{
652
-
653
652
if(`$ PropertyGroup.StartAction -ne `$ null)
654
653
{
655
654
`$ proceed = `$ false
656
655
}
657
-
658
656
}
659
657
660
658
if (`$ proceed -eq `$ true){
661
- `$ propertyGroupElement = `$ prjXml.CreateElement(`" PropertyGroup`" );
662
- `$ propertyGroupElement.SetAttribute(`" Condition`" , `" '```$ (Configuration)|```$ (Platform)' == 'Release|AnyCPU'`" )
663
- `$ propertyGroupElement.RemoveAttribute(`" xmlns`" )
664
- `$ startActionElement = `$ prjXml.CreateElement(`" StartAction`" );
659
+ `$ propertyGroupElement = `$ prjXml.CreateElement(`" PropertyGroup`" , `$ prjXml.Project.GetAttribute(`" xmlns`" ));
660
+ `$ startActionElement = `$ prjXml.CreateElement(`" StartAction`" , `$ prjXml.Project.GetAttribute(`" xmlns`" ));
665
661
`$ propertyGroupElement.AppendChild(`$ startActionElement)
666
662
`$ propertyGroupElement.StartAction = `" Program`"
667
- `$ startProgramElement = `$ prjXml.CreateElement(`" StartProgram`" );
663
+ `$ startProgramElement = `$ prjXml.CreateElement(`" StartProgram`" , `$ prjXml.Project.GetAttribute( `" xmlns `" ) );
668
664
`$ propertyGroupElement.AppendChild(`$ startProgramElement)
669
665
`$ propertyGroupElement.StartProgram = `"```$ (ProjectDir)```$ (OutputPath)NServiceBus.Host.exe`"
670
666
`$ prjXml.project.AppendChild(`$ propertyGroupElement);
671
667
`$ writerSettings = new-object System.Xml.XmlWriterSettings
672
- `$ writerSettings.OmitXmlDeclaration = `$ true
673
- `$ writerSettings.NewLineOnAttributes = `$ true
668
+ `$ writerSettings.OmitXmlDeclaration = `$ false
669
+ `$ writerSettings.NewLineOnAttributes = `$ false
674
670
`$ writerSettings.Indent = `$ true
675
671
`$ projectFilePath = Resolve-Path -Path `$ project.FullName
676
672
`$ writer = [System.Xml.XmlWriter]::Create(`$ projectFilePath, `$ writerSettings)
677
-
678
673
`$ prjXml.WriteTo(`$ writer)
679
674
`$ writer.Flush()
680
675
`$ writer.Close()
681
- }
682
- }
683
- else{
684
- echo `" Please use PowerShell V2 for better configuration for the project`"
685
- }
676
+ }
686
677
"
687
678
$appConfigTranformFile = " $releaseRoot \content\app.config.transform"
688
679
$installPs1File = " $releaseRoot \tools\install.ps1"
0 commit comments