Dumber_Texan2
Dumber_Texan2

Reputation: 978

Azure DevOps Pipeline Rollback file for .NET MAUI install fails with '<' is an invalid start of a value

Here is the error message.

Workload installation failed: '<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.

Here is the Rollback file I created.

{
  "microsoft.net.sdk.ios": "17.2.8004/8.0.100",
  "microsoft.net.sdk.maui": "8.0.3/8.0.100"
}

Here is the script.

- task: CmdLine@2
  displayName: 'Install Maui & iOS'
  inputs:
    script: 'dotnet workload install maui maui-ios --from-rollback-file https://www.mywebsite.com/Rollback/MauiJson --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json --source https://api.nuget.org/v3/index.json'

I'm trying to create a Rollback file for .NET MAUI 8.0.3. This is for an iOS app.

Any help is much appreciated. Thanks!

Upvotes: 0

Views: 365

Answers (1)

Alvin Zhao - MSFT
Alvin Zhao - MSFT

Reputation: 6022

Based on your requirement, I managed to running the command referencing the local json file with source from https://api.nuget.org/v3/index.json.

parameters:
  - name: MauiJson
    type: object
    default:
      microsoft.net.sdk.ios: 17.2.8004/8.0.100
      microsoft.net.sdk.maui: 8.0.3/8.0.100
variables:
  MauiJson:  ${{ convertToJson(parameters.MauiJson) }}

steps:
- script: |
    ls
    echo '$(MauiJson)' > MauiJson.json
    ls
  displayName: 'Create MauiJson.json'

- task: CmdLine@2
  displayName: 'Install Maui & iOS'
  inputs:
    script: |
      cat MauiJson.json
      dotnet workload install maui maui-ios --from-rollback-file MauiJson.json --source https://api.nuget.org/v3/index.json

enter image description here

Hope this command could work for you as well. You may narrow down the cause of the issue caused by either your remote json contents or the package(s) in your Azure Artifacts source feed.

Upvotes: 3

Related Questions