Skip to content

Getting wrong .NET version #679

@chilo-ms

Description

@chilo-ms

Description:

Our CI is supposed to use .NET version 8/9 but it's using the latest .NET version 10.0.0 to run dotnet CLI which makes our CI failed.

....
Failed to load the dll from [C:\Program Files\dotnet\host\fxr\10.0.0\hostfxr.dll], HRESULT: 0x800700C1
The library hostfxr.dll was found, but loading it from C:\Program Files\dotnet\host\fxr\10.0.0\hostfxr.dll failed
  - Installing .NET prerequisites might help resolve this problem.
     https://go.microsoft.com/fwlink/?linkid=798306
Failed to resolve hostfxr.dll [C:\Program Files\dotnet\host\fxr\10.0.0\hostfxr.dll]. Error code: 0x80008082
...

Even though the YAML specifies:

      - name: Use .NET 8.x
        uses: actions/setup-dotnet@v5
        with:
          dotnet-version: '8.x'
        env:
          PROCESSOR_ARCHITECTURE: x86 # x86 .NET

or providing the global.json as suggested:

      - name: Create global.json
        shell: pwsh
        working-directory: ${{ github.workspace }}
        run: |
          $globalJson = @{
            sdk = @{
              version = "8.0.100"
              rollForward = "latestMinor"
            }
          } | ConvertTo-Json
          $globalJson | Out-File -FilePath "global.json" -Encoding utf8

Both didn't work.

How can we address this issue? We want to use the dotnet 8 or 9.

See the GH actions here.
https://github.com/microsoft/onnxruntime/actions/runs/19317891690/job/55252967941?pr=26561

Task version:
Specify the task version

Platform:

  • Windows

Runner type:

  • Hosted

Repro steps:
A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.

Expected behavior:
A description of what you expected to happen.

Actual behavior:
A description of what is actually happening.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions