teamcity-dotnet-plugin icon indicating copy to clipboard operation
teamcity-dotnet-plugin copied to clipboard

"Property is not valid" error caused by invalid values in rsp file

Open brainmeyers opened this issue 1 year ago • 3 comments

I am having the same problem as Issue 85

I am using the latest version of Team City [2022.04.1 (build 108575)] and the latest version of .net 6 SDK (6.0.301) so I am not sure why previous fixes are not working in my case.

I get the same "Property is not valid" error. Here is the errors from the log file:

[14:06:48][dotnet build] Starting: .NET SDK 6.0.301 "C:\Program Files\dotnet\dotnet.exe" build E:\TeamCity\BuildAgent3\work\d35fb6d8451a3848\BackOffice\src\BackOffice.sln --configuration release @E:\TeamCity\BuildAgent3\temp\agentTmp\1.rsp -p:Version=7.2207.75.0
[14:06:48][dotnet build] in directory: E:\TeamCity\BuildAgent3\work\d35fb6d8451a3848
[14:06:49][dotnet build] Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
[14:06:49][dotnet build] Copyright (C) Microsoft Corporation. All rights reserved.
[14:06:49][dotnet build] 
[14:06:49][dotnet build] MSBUILD : error MSB1006: Property is not valid.
[14:06:49][dotnet build] Switch: E:\TeamCity\BuildAgent3\plugins\dotnet\tools\vstest15
[14:06:49][dotnet build] 
[14:06:49][dotnet build] For switch syntax, type "MSBuild -help"
[14:06:49][dotnet build] Process exited with code 1
[14:06:49][dotnet build] Process exited with code 1 (Step: Compile (.NET))

I get the same error if I run the command manually on the server.

The property with the problem is this one:

  • -p:VSTestTestAdapterPath=".;E:\TeamCity\BuildAgent2\plugins\dotnet\tools\vstest15"

If I remove that property, it also complains about the common in these two properties:

  • -p:Company="MyCompany, LLC"
  • -p:Copyright="Copyright 2007-2022 MyCompany, LLC"

If I remove all three properties then the build is successful.

Here is the full contents of my rsp file that is generated by the plug in.

/noconsolelogger
"/l:TeamCity.MSBuild.Logger.TeamCityMSBuildLogger,E:\TeamCity\BuildAgent2\plugins\dotnet\tools\msbuild15\TeamCity.MSBuild.Logger.dll;TeamCity;plain"
/nodeReuse:false
-p:VSTestLogger=logger://teamcity
-p:VSTestTestAdapterPath=".;E:\TeamCity\BuildAgent2\plugins\dotnet\tools\vstest15"
-p:VSTestVerbosity=normal
-p:Company="MyCompany, LLC"
-p:Copyright="Copyright 2007-2022 MyCompany, LLC"
-p:FxCopCmdFileVersion=17.0.32408.312
-p:FxCopRoot="C:\Program Files\Microsoft Visual Studio\2022\Professional\Team Tools\Static Analysis Tools\FxCop"
-p:Product=MyProduct
-p:Version=7.2207.66.0
-p:agent_home_dir=E:\TeamCity\BuildAgent2
-p:agent_name=myserver-2
-p:agent_work_dir=E:\TeamCity\BuildAgent2\work
-p:build_number=7.2207.66.0
-p:build_vcs_number=91bae018adea7de834d12a2984d4a0e8d7949f23
-p:build_vcs_number_1=91bae018adea7de834d12a2984d4a0e8d7949f23
-p:build_vcs_number_MarketRisk=91bae018adea7de834d12a2984d4a0e8d7949f23
-p:java_io_tmpdir=E:\TeamCity\BuildAgent2\temp\buildTmp
-p:teamcity_agent_cpuBenchmark=701
-p:teamcity_agent_dotnet_agent_url=http://localhost:9092/RPC2
-p:teamcity_agent_dotnet_build_id=94542
-p:teamcity_auth_password=huyPY7F88R5FZy1gixKxSaC3BMnR0JMn
-p:teamcity_auth_userId=TeamCityBuildId=94542
-p:teamcity_build_changedFiles_file=E:\TeamCity\BuildAgent2\temp\buildTmp\changedFiles13551652186946832154.txt
-p:teamcity_build_checkoutDir=E:\TeamCity\BuildAgent2\work\e699bff09e84026e
-p:teamcity_build_properties_file=E:\TeamCity\BuildAgent2\temp\buildTmp\teamcity.build14952762054516357846.properties
-p:teamcity_build_tempDir=E:\TeamCity\BuildAgent2\temp\buildTmp
-p:teamcity_build_workingDir=E:\TeamCity\BuildAgent2\work\e699bff09e84026e
-p:teamcity_buildConfName="Market Risk"
-p:teamcity_buildType_id=MarketRisk
-p:teamcity_configuration_properties_file=E:\TeamCity\BuildAgent2\temp\buildTmp\teamcity.config14620525786986346717.properties
-p:teamcity_dotnet_nunitaddin=E:\TeamCity\BuildAgent2\plugins\dotnetPlugin\bin\JetBrains.TeamCity.NUnitAddin-NUnit
-p:teamcity_dotnet_nunitlauncher=E:\TeamCity\BuildAgent2\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe
-p:teamcity_dotnet_nunitlauncher_msbuild_task=E:\TeamCity\BuildAgent2\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MSBuildLoggers.dll
-p:teamcity_dotnet_nunitlauncher1_1=E:\TeamCity\BuildAgent2\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher1.1.exe
-p:teamcity_dotnet_nunitlauncher2_0=E:\TeamCity\BuildAgent2\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.exe
-p:teamcity_dotnet_nunitlauncher2_0_vsts=E:\TeamCity\BuildAgent2\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.VSTS.exe
-p:teamcity_dotnet_platform=E:\TeamCity\BuildAgent2\plugins\dotnetPlugin\bin\JetBrains.TeamCity.PlatformProcessRunner.1.1.exe
... // A few others that were not relevant.
-p:teamcity_runner_properties_file=E:\TeamCity\BuildAgent2\temp\buildTmp\teamcity.runner3768283398225612084.properties
-p:teamcity_tests_recentlyFailedTests_file=E:\TeamCity\BuildAgent2\temp\buildTmp\testsToRunFirst1157672091888223247.txt
-p:teamcity_version="2022.04.1 (build 108575)"

I could probably get by with removing the comma in the Company and Copyright properties, but VSTestTestAdapterPath appears to be something generated by the plugin.

I do believe it was working at one time, but I recently installed VS 2022 on the build server and that may or may not have contributed to the problem.

Please let me know if there is any other information that may be useful in resolving this issue.

brainmeyers avatar Jul 12 '22 19:07 brainmeyers

I don't know why I spent the whole day researching the problem only to find this similar issue right after I created one:

https://github.com/JetBrains/teamcity-dotnet-plugin/issues/158

It may solve my problem. I will try the solution and revert back.

brainmeyers avatar Jul 12 '22 19:07 brainmeyers

The solution from #158 did in fact resolve my problem with the p:VSTestTestAdapterPath property.

It did not resolve my error with these two custom parameters

-p:Company="MyCompany, LLC" -p:Copyright="Copyright 2007-2022 MyCompany, LLC"

I get the same error, but now related to the Company property

[14:06:49][dotnet build] MSBUILD : error MSB1006: Property is not valid.
[14:06:49][dotnet build] Switch: LLC

It is an easy solution for me to remove the comma from my property value. So this isn't stopping me anymore. But it may be something to consider improving in a future version.

brainmeyers avatar Jul 12 '22 19:07 brainmeyers

Please try this version

NikolayPianikov avatar Jul 14 '22 07:07 NikolayPianikov