Skip to content

Support for target runtimes. #72

Open
@JimBobSquarePants

Description

@JimBobSquarePants

Looking at the documentation and the code it appears the SDK runtime platform architecture is determined by the architecture of the OS.

It would be very useful for unit testing scenarios to allow specifying whether the x86 or x64 SDK is in use as dotnet test requires the explicit architecture.

Activity

coderpatros

coderpatros commented on Jun 28, 2020

@coderpatros
Contributor

From my looking it is explicitly set to x64

It's probably a corner case, but it could cause issues if someone is running an x86 self hosted runner.

AaronRobinsonMSFT

AaronRobinsonMSFT commented on Dec 9, 2021

@AaronRobinsonMSFT

Any thoughts resurrecting the following PR: #152

I'd like a way to specify the architecture too. I need to test on win-x86 and setting that up is complicated.

linked a pull request that will close this issue on Oct 21, 2022
linked a pull request that will close this issueAdd a way to force the architecture #338on Jul 3, 2023
baynezy

baynezy commented on Jan 22, 2025

@baynezy

I need to test some code with x86 and so this is a blocker for me.

brantburnett

brantburnett commented on Mar 13, 2025

@brantburnett

I have found a workaround I use in my workflows that's not TOO cumbersome. Note that this example assumes Windows for the OS.

# This must be done before the normal setup-dotnet action to ensure DOTNET_ROOT refers to the 64-bit installation
- name: Setup .NET x86
  uses: actions/setup-dotnet@v4
  env:
    PROCESSOR_ARCHITECTURE: x86
    DOTNET_INSTALL_DIR: C:\Program Files (x86)\dotnet
  with:
    dotnet-version: 8.0.x

# Copy DOTNET_ROOT from the above step to DOTNET_ROOT(x86), the next step will overwrite DOTNET_ROOT to refer to the 64-bit installation
- name: Set DOTNET_ROOT(x86)
  shell: pwsh
  run: |
    echo "DOTNET_ROOT(x86)=${env:DOTNET_ROOT}" | Out-File -FilePath $env:GITHUB_ENV -Append
 
- name: Setup .NET
  uses: actions/setup-dotnet@v4
  with:
    dotnet-version: 8.0.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or request to improve the current logic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @JimBobSquarePants@baynezy@coderpatros@ZEisinger@brantburnett

      Issue actions

        Support for target runtimes. · Issue #72 · actions/setup-dotnet