question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support installing multiple versions of .NET Core SxS

See original GitHub issue

I would like to use this action to setup .NET Core for some class libraries I support. I like to run tests on multiple versions of .NET Core, but it appears I cannot use this task to install multiple versions of .NET Core.

Repro

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/setup-dotnet@v1
      with:
        version: '2.1.801'        
    - run: dotnet --info
    - uses: actions/setup-dotnet@v1
      with:
        version: '3.0.100-preview8-013656'
    - run: dotnet --info

Expected

Both .NET Core 2.1 and 3.0 are installed and available when running dotnet commands.

Actual

Usages of actions/setup-dotnet are not additive; the last one wins, so only 3.0.100-preview8-013656 is available.

logs.zip

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:43
  • Comments:40 (17 by maintainers)

github_iconTop GitHub Comments

19reactions
natemcmastercommented, Aug 23, 2019

Here is one use case (there are more, but this is the most common). Consider, for instance, a test project file like this:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
     <TargetFrameworks>netcoreapp3.0;netcoreapp2.2;netcoreapp2.1</TargetFrameworks>
  </PropertyGroup>
  <ItemGroup>
     <PackageReference Include="xunit" Version="2.4.1" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.0" />
  </ItemGroup>
</Project>

When you run dotnet test for this project, the test runner will launch tests for the three versions of .NET Core listed, 2.1, 2.2, and 3.0. If only 3.0 is installed, the 2.1 and 2.2 test runs would fail.

The way to make this work is to install all versions of .NET Core into the same root folder.

18reactions
alaatmcommented, Nov 22, 2019

The following can be used as a workaround until this gets implemented:

  - name: Setup .net core 2.2
    uses: actions/setup-dotnet@v1
    with:
      dotnet-version: 2.2.402

  - name: Setup .net core 3.0
    uses: actions/setup-dotnet@v1
    with:
      dotnet-version: 3.0.100

  - name: .net SxS
    run: |
      rsync -a ${DOTNET_ROOT/3.0.100/2.2.402}/* $DOTNET_ROOT/

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to install multiple versions of .NET Core side by side on ...
Installing multiple versions of dotnet runtime to separate directories. For the latest runtime installation, add symlinks for each of the older ...
Read more >
How to install multiple versions of .NET Core side ... - DevDojo
I always knew that there should be a straightforward way to install multiple sdks because of dotnet --list-sdks command which suppose to display ......
Read more >
Hot to install multiple .NET Core versions in Linux - YouTube
How to download and install more than one . NET Core versions.. Net Core playlist: ...
Read more >
How to Install .NET Framework 3.5 on Windows 11/10 and ...
Use the different SXS sources for different versions of Windows Server. If you are running multiple versions of Windows Server on your network,...
Read more >
How to install the .NET Framework 3.5 on Windows Server ...
NET Framework 3.5 installed on your Windows Server 2016 and later. By default, the . ... -Name "NET-Framework-Core" -Source "D:\Sources\SxS".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found