Property is not valid error caused by auto removal of quotes from MSBuild options

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

When running an MSBuild task, bamboo  removes the quotes around the property value which cause the build to fail. As mentioned in a Microsoft document regarding this error: MSBuild Error MSB1006 because semicolons are used as a property separator, the remaining part after quotes are removed will be an invalid expression.

例 1:

/t:Release /p:BuildVersion="1.0.0.${bamboo.buildNumber}" 
/p:ProductsToRelease="JIRA;Bamboo;Fisheye"

If quotes are not deleted, all the three options are considered as values of the property ProductsToRelease.

例 2:

/p:Configuration="Any CPU";Platform=x64;...


Following is the error that shows up when running the build:

MSBUILD : error MSB1006: Property is not valid.


ソリューション

アップグレード

This problem was fixed in Bamboo 5.8. If possible upgrade to this version or a newer one.

If an upgrade is not possible then a possible workaround is presented below:


回避策

The possible workarounds for versions of Bamboo before version 5.8 are:

  1. use single quotes to quote the quotes to preserver your parameters. Instead of:

    /p:ProductsToRelease="JIRA;Bamboo;Fisheye"

    Use:

    /p:ProductsToRelease='"'JIRA;Bamboo;Fisheye'"'
  2. Place all the options as a single line in a msbuild.rsp file in the directory that the build solution or project resides then running the MSBuild task with empty options.

最終更新日: 2019 年 10 月 7 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.