Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem parsing .rsp with .NET SDK 6.0.301 #158

Closed
rokleM opened this issue Jun 15, 2022 · 21 comments
Closed

Problem parsing .rsp with .NET SDK 6.0.301 #158

rokleM opened this issue Jun 15, 2022 · 21 comments
Assignees
Labels

Comments

@rokleM
Copy link

rokleM commented Jun 15, 2022

When I try to start a build I get this:

dotnet restore
Starting: .NET SDK 6.0.301 "C:\Program Files\dotnet\dotnet.exe" restore B:\BuildAgents\work\d1489dc070d6d243\MSBuildTasks.sln --source https://api.nuget.org/v3/index.json --source https://localhost:8111/httpAuth/app/nuget/feed/_Root/default/v2 @b:\BuildAgents\BuildAgent3\temp\agentTmp\1.rsp
in directory: B:\BuildAgents\work\d1489dc070d6d243
MSBUILD : error MSB1006: Property is not valid.
Switch: B:\BuildAgents\BuildAgent3\plugins\dotnet\tools\vstest15
For switch syntax, type "MSBuild -help"
Process exited with code 1

This started happening once I updated BuildTools to 17.2.4, which includes said SDK.

@alvaromarithompson
Copy link

+1 on this, I've also just updated to latest version of .net 6 (6.0.301) and have started seeing this issue in Linux/Debian:

[21:28:18]E: Step 1/14: Publish (.NET)
[21:28:18]i:     [Step 1/14] dotnet --version
[21:28:18]i:     [Step 1/14] Starting:  Getting the .NET SDK version /usr/share/dotnet/ dotnet  --version
[21:28:18]i:     [Step 1/14] in directory:  /opt/teamcity-agent-1/work/eddc24f5d5a9ddc4
[21:28:18]i:     [Step 1/14] 6.0.301
[21:28:18]i:     [Step 1/14] Process exited with code 0
[21:28:18]E:     [Step 1/14] dotnet publish
[21:28:18] :         [dotnet publish] Starting:  [30;1m.NET SDK 6.0.301  [0m/usr/share/dotnet/dotnet publish /opt/teamcity-agent-1/work/eddc24f5d5a9ddc4/Src/XXXXX.sln --configuration Release --output output/ @/opt/teamcity-agent-1/temp/agentTmp/1.rsp -p:PackageVersion=1.0.1767 -p:OutputPath=output/ -p:PublishDir=output/
[21:28:18] :         [dotnet publish] in directory: /opt/teamcity-agent-1/work/eddc24f5d5a9ddc4
[21:28:18] :         [dotnet publish] Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
[21:28:18] :         [dotnet publish] Copyright (C) Microsoft Corporation. All rights reserved.
[21:28:18] :         [dotnet publish] 
[21:28:18] :         [dotnet publish] MSBUILD : error MSB1006: Property is not valid.
[21:28:18] :         [dotnet publish] Switch: /opt/teamcity-agent-1/plugins/dotnet/tools/vstest15
[21:28:18] :         [dotnet publish] 
[21:28:18] :         [dotnet publish] For switch syntax, type "MSBuild -help"
[21:28:18]W:         [dotnet publish] Process exited with code 1
[21:28:18]E:         [dotnet publish] Process exited with code 1 (Step: Publish (.NET))

When looking at /opt/teamcity-agent-1/temp/agentTmp/1.rsp I can see the following line:

-p:VSTestTestAdapterPath=".;/opt/teamcity-agent-1/plugins/dotnet/tools/vstest15"

When I modify it to the below:

-p:VSTestTestAdapterPath="/opt/teamcity-agent-1/plugins/dotnet/tools/vstest15"

And then run the same command via bash, it works ok, but next time I run a build on TeamCity the 1.rsp file re-generates and the same problem occurs.

@alvaromarithompson
Copy link

This seems to have been reported to the main dotnet sdk repo dotnet/sdk#26026

@NikolayPianikov
Copy link
Contributor

Could you please uprade the .NET plugin for TeamCity 2022

@alvaromarithompson
Copy link

That's worked @NikolayPianikov - many thanks!

@loop-evgeny
Copy link

Could you please uprade the .NET plugin for TeamCity 2022

Thanks, but even with this update the build fails when the build configuration name contains a comma.

-p:teamcity_buildConfName="Linux, DebugMode off"

error:

[dotnet build] MSBUILD : error MSB1006: Property is not valid.
[dotnet build] Switch: DebugMode off)

@StephanMoeller
Copy link

NikolayPianikov We use sentinelOne, and after installing the ".NET plugin" you mentioned, sentinelOne classifies it as ransomware due to its behaviour. Is this something you can comment on?

@NikolayPianikov
Copy link
Contributor

@loop-evgeny please try this plugin

@NikolayPianikov
Copy link
Contributor

@SRYER What program did this classification? .NET plugin doesn't have such feature

@loop-evgeny
Copy link

@loop-evgeny please try this plugin

That works with a comma in the build configuration name, thanks! It's URL-encoded in the 1.rsp file now:

-p:teamcity_buildConfName="engine (Linux%2C DebugMode off)"

@akulich
Copy link

akulich commented Jun 23, 2022

@loop-evgeny please try this plugin

We are currently on TeamCity 2020.2.4. Would the above plugin work for it or could you post a version for TC 2020.2? Thanks.

@RickyLin
Copy link

As a workaround, currently I add a global.json file in my solution to specify a particular .NET SDK version other than 6.0.301, then everything works again. The global.json file can be removed after this issue gets solved.

@Danielku15
Copy link

A hint to the readers of this issue (which I missed first): the global.json does not need to be in the working/solution directory. You can also just place a global.json in your drive-root so that all builds on your server use this SDK version. This way we avoided updating all of our repositories and branches.

@schwede
Copy link

schwede commented Jun 23, 2022

I've tried the new plugin but I'm having issues with multiple Nuget package sources. I tried to URL encode the semicolon separator but it looks like Team City parses the list and replaces my URL encoded semicolons with regular semicolons. Any workarounds for that or should I just force to SDK 6.0.300 instead?

@NikolayPianikov
Copy link
Contributor

@schwede what command are you using?

@schwede
Copy link

schwede commented Jun 24, 2022

restore
I tried to provide --source commands directly in the command line arguments to workaround it but I can't clear what's put in the package sources in the rsp file. There must be some kind of inherited behavior in my build because I get the same text in "-p:PackageSources" no matter what I put in "NuGet package sources".

@charliemckeegan
Copy link

I'm getting the same issue with .NET restore, I pass in a Nuget.config file and get an error with the urls being passed as switches.

[dotnet restore] MSBUILD : error MSB1006: Property is not valid.
[dotnet restore] Switch: https://xxxxxxx/guestAuth/app/nuget/v1/FeedService.svc/

@Fabman08
Copy link

@NikolayPianikov Can you explain how to install the plugin please?

@LionetChen
Copy link

@NikolayPianikov Can you explain how to install the plugin please?

Administration -> Plugins -> [Upload plugin zip]

Then restart server as prompted.

@haldiggs
Copy link

haldiggs commented Aug 3, 2022

same issue here. about to install TeamCity upgrade. I am hoping this does not cause further issues. All of our builds broke using 6.0.300

@waf
Copy link

waf commented Aug 11, 2022

It looks like the root cause in dotnet/sdk#26026 is fixed as of .NET 6.0.303. I installed the latest version of .NET (6.0.400) and deleted my global.json workaround -- everything's working as expected now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests