History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-2695
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Steve Luo
Reporter: Alexey Shumkin
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

MSBuild: step fails with the "MSBUILD : error MSB1006: Property is not valid. Switch ..."

Created: 13/Apr/16 03:44 PM   Updated: 17/Feb/17 04:04 PM
Component/s: None
Affects Version/s: 6.1.2
Fix Version/s: 6.1.13

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
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  « Hide
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)

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.

 All   Comments   Work Log   Change History      Sort Order:
Alexey Shumkin [13/Apr/16 03:49 PM]
JFI: another workaround here for me is to set

but obviuosly this works for the MSBuild.ExtensionPack.Communication.Email task only

Alexey Shumkin [17/Feb/17 04:04 PM]
confirm fix )