Paket.Restore.targets(122,9): error MSB4184: The expression ""System.String[]".GetValue(4)" cannot be evaluated

Created on 11 Jan 2018  Â·  3Comments  Â·  Source: fsprojects/Paket

Description

I have just converted a solution to use Paket. When I execute msbuild /t:Restore for every project in the solution I get:

msbuild /t:Restore
Microsoft (R) Build Engine version 15.5.180.51428 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 2018/01/10 3:27:46 PM.
Project "C:\src\appcenter.petshr\analytics-eventhubreader\analytics-eventhubreader.sln" on node 1 (Restore target(s)).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|Any CPU".
Project "C:\src\appcenter.petshr\analytics-eventhubreader\analytics-eventhubreader.sln" (1) is building "C:\src\appcenter.petshr\analytics-eventhubreader\src\lib\AppCenter.Policy\AppCenter.Policy.csproj" (3:2) on node 1 (_GenerateRestoreProjectPathWalk target(s)).
Project "C:\src\appcenter.petshr\analytics-eventhubreader\src\lib\AppCenter.Policy\AppCenter.Policy.csproj" (3:2) is building "C:\src\appcenter.petshr\analytics-eventhubreader\src\lib\AppCenter.Con figuration\AppCenter.Configuration.csproj" (7:2) on node 1 (_GenerateRestoreProjectPathWalk target(s)).
C:\src\appcenter.petshr\analytics-eventhubreader\.paket\Paket.Restore.targets(122,9): error MSB4184: The expression ""System.String[]".GetValue(4)" cannot be evaluated. Index was outside the bounds  of the array. [C:\src\appcenter.petshr\analytics-eventhubreader\src\lib\AppCenter.Configuration\AppCenter.Configuration.csproj]
Done Building Project "C:\src\appcenter.petshr\analytics-eventhubreader\src\lib\AppCenter.Configuration\AppCenter.Configuration.csproj" (_GenerateRestoreProjectPathWalk target(s)) -- FAILED.

Followed by failures for all projects.

Repro steps

  1. All SDK csproj projects.
  2. Execute .\.paket\paket.exe install
  3. Execute msbuild /t:Restore

Paket.Restore.targets is unchanged from what the bootstrapper installs.
Paket version 5.129.2

Expected behavior

Everything is restored without errors.

Actual behavior

Restore fails for all projects.

Known workarounds

Revert Paket changes and use the NuGet client.

Most helpful comment

Can you please delete all /obj folders and retry?

Am 11.01.2018 00:34 schrieb "Peter Shrosbree" notifications@github.com:

Description

I have just converted a solution to use Paket. When I execute msbuild
/t:Restore for every project in the solution I get:

Microsoft (R) Build Engine version 15.5.180.51428 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 2018/01/10 3:27:46 PM.
Project "C:\src\appcenter.petshr\analytics-eventhubreader\analytics-eventhubreader.sln" on node 1 (Restore target(s)).
ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Project "C:\src\appcenter.petshr\analytics-eventhubreader\analytics-eventhubreader.sln" (1) is building "C:\src\appcenter.petshr\analytics-eventhubreader\src\lib\AppCenter.Policy\AppCenter.Policy.csproj" (3:2) on node 1 (_GenerateRestoreProjectPathWalk target(s)).
Project "C:\src\appcenter.petshr\analytics-eventhubreader\src\lib\AppCenter.Policy\AppCenter.Policy.csproj" (3:2) is building "C:\src\appcenter.petshr\analytics-eventhubreader\src\lib\AppCenter.Con figuration\AppCenter.Configuration.csproj" (7:2) on node 1 (_GenerateRestoreProjectPathWalk target(s)).
C:\src\appcenter.petshr\analytics-eventhubreader.paketPaket.Restore.targets(122,9): error MSB4184: The expression ""System.String[]".GetValue(4)" cannot be evaluated. Index was outside the bounds of the array. [C:\src\appcenter.petshr\analytics-eventhubreader\src\lib\AppCenter.Configuration\AppCenter.Configuration.csproj]
Done Building Project "C:\src\appcenter.petshr\analytics-eventhubreader\src\lib\AppCenter.Configuration\AppCenter.Configuration.csproj" (_GenerateRestoreProjectPathWalk target(s)) -- FAILED.```

Followed by failures for all projects.

Repro steps

  1. All SDK csproj projects.
  2. Execute .\.paket\paket.exe install
  3. Execute msbuild /t:Restore

Paket.Restore.targets is unchanged from what the bootstrapper installs.
Paket version 5.129.2

Expected behavior

Everything is restored without errors.

Actual behavior

Restore fails for all projects.

Known workarounds

Revert Paket changes and use the NuGet client.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/fsprojects/Paket/issues/2975, or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNAPpPY_uyX-k9ECGdD2i_7DQ0OTrks5tJUj7gaJpZM4RaGvE
.

All 3 comments

Can you please delete all /obj folders and retry?

Am 11.01.2018 00:34 schrieb "Peter Shrosbree" notifications@github.com:

Description

I have just converted a solution to use Paket. When I execute msbuild
/t:Restore for every project in the solution I get:

Microsoft (R) Build Engine version 15.5.180.51428 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 2018/01/10 3:27:46 PM.
Project "C:\src\appcenter.petshr\analytics-eventhubreader\analytics-eventhubreader.sln" on node 1 (Restore target(s)).
ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Project "C:\src\appcenter.petshr\analytics-eventhubreader\analytics-eventhubreader.sln" (1) is building "C:\src\appcenter.petshr\analytics-eventhubreader\src\lib\AppCenter.Policy\AppCenter.Policy.csproj" (3:2) on node 1 (_GenerateRestoreProjectPathWalk target(s)).
Project "C:\src\appcenter.petshr\analytics-eventhubreader\src\lib\AppCenter.Policy\AppCenter.Policy.csproj" (3:2) is building "C:\src\appcenter.petshr\analytics-eventhubreader\src\lib\AppCenter.Con figuration\AppCenter.Configuration.csproj" (7:2) on node 1 (_GenerateRestoreProjectPathWalk target(s)).
C:\src\appcenter.petshr\analytics-eventhubreader.paketPaket.Restore.targets(122,9): error MSB4184: The expression ""System.String[]".GetValue(4)" cannot be evaluated. Index was outside the bounds of the array. [C:\src\appcenter.petshr\analytics-eventhubreader\src\lib\AppCenter.Configuration\AppCenter.Configuration.csproj]
Done Building Project "C:\src\appcenter.petshr\analytics-eventhubreader\src\lib\AppCenter.Configuration\AppCenter.Configuration.csproj" (_GenerateRestoreProjectPathWalk target(s)) -- FAILED.```

Followed by failures for all projects.

Repro steps

  1. All SDK csproj projects.
  2. Execute .\.paket\paket.exe install
  3. Execute msbuild /t:Restore

Paket.Restore.targets is unchanged from what the bootstrapper installs.
Paket version 5.129.2

Expected behavior

Everything is restored without errors.

Actual behavior

Restore fails for all projects.

Known workarounds

Revert Paket changes and use the NuGet client.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/fsprojects/Paket/issues/2975, or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNAPpPY_uyX-k9ECGdD2i_7DQ0OTrks5tJUj7gaJpZM4RaGvE
.

I tried deleting the obj folders. It did not make any difference. However, when executing in PowerShell, I do not get this issue. I use cmder, so instead I tried the standard cmd.exe on Windows, and it too does not generate these errors. This is a little odd, but not likely a problem with Paket, so I'll close this issue.

Just closing the loop on this so if others are as dumb as I am they may have an easier time of it.

I encountered the problem again, even in PowerShell, but found I had install paket globally with choco install paket. Running choco upgrade paket upgraded to 5.130.3 and this seems to have fixed the problem in all shells.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NatElkins picture NatElkins  Â·  6Comments

alfonsogarciacaro picture alfonsogarciacaro  Â·  4Comments

ModernRonin picture ModernRonin  Â·  7Comments

forki picture forki  Â·  5Comments

sarudak picture sarudak  Â·  5Comments