<< Back to previous view

[QB-2695] MSBuild: step fails with the "MSBUILD : error MSB1006: Property is not valid. Switch ..."
Created: 13/Apr/16  Updated: 17/Feb/17

Status: Resolved
Project: QuickBuild
Component/s: None
Affects Version/s: 6.1.2
Fix Version/s: 6.1.13

Type: Bug Priority: Major
Reporter: Alexey Shumkin Assigned To: Steve Luo
Resolution: Fixed Votes: 0
Remaining Estimate: Unknown Time Spent: Unknown
Original Estimate: Unknown
Environment: Server Information
System Date and Time 2016-04-13 18:05:50
Operating System Linux 3.13.0-32-generic, amd64
JVM OpenJDK 64-Bit Server VM 1.7.0_91, Oracle Corporation
QuickBuild Version 6.1.2 - Fri Jan 08 01:30:14 UTC 2016


 Description   
I run a task sending email-notification.
Task is "MSBuild.ExtensionPack.Communication.Email" from "MSBuild Extension Pack".
It has several recipients passed as a list with a ";" (semicolon) delimiter.

So, step is msbuild task, properties are
EmailSender=Quickbuild <quickbuild@DRCIS-2008>
EmailRecipient="recipient1@domain.com;recipient2@domain.com" (yes, already quoted, as QB itself does not quote msbuild properties)
AnyOtherProperty=Value

run
step fails
17:54:10,501 DEBUG - Executing command: msbuild.exe /nologo /t:sendmail "/property:EmailSender=Quickbuild <quickbuild@DRCIS-2008>;EmailRecipient="recipient1@domain.com;recipient2@domain.com";AnyOtherProperty=Value" /noconsolelogger "/l:QBLogger,C:\Program Files\QBAgent\framework\configuration\org.eclipse.osgi\com\pmease\quickbuild\plugin\builder\msbuild\PMEase.QuickBuild.MSBuild.Logger.dll;v=detailed" <PROJECT_FILE>
17:54:10,592 ERROR - MSBUILD : error MSB1006: Property is not valid.
17:54:10,592 INFO - Switch: recipient2@domain.com

Obviously, MSBuild uses ";" as a properties delimiter, too.
And it does respect quoted values "inside" one /property switch
For example, if I run
msbuild.exe /nologo /t:sendmail /property:EmailSender=quickbuild@DRCIS-2008;EmailRecipient="recipient1@domain.com;recipient2@domain.com"
or even
msbuild.exe /nologo /t:sendmail /property:EmailSender="Quickbuid <quickbuild@DRCIS-2008>";EmailRecipient="recipient1@domain.com;recipient2@domain.com"
they will succeed

but if I set (in QB task) EMailSender property to a value containing spaces (EmailSender=Quickbuild <quickbuild@DRCIS-2008>), build will fail
as all the msbuild parameter "/property:..." is whole quoted

Fortunately, I can workaround this by using EmailSender property without spaces, but generally I consider this as a bug.


 Comments   
Comment by Alexey Shumkin [ 13/Apr/16 03:49 PM ]
JFI: another workaround here for me is to set
EmailSender=Quickbuild%20<quickbuild@DRCIS-2008>

but obviuosly this works for the MSBuild.ExtensionPack.Communication.Email task only
Comment by Alexey Shumkin [ 17/Feb/17 04:04 PM ]
confirm fix )
Generated at Fri May 03 18:19:05 UTC 2024 using JIRA 189.