You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to test using older target frameworks following setup #136
It used to be possible to specify an older target framework. For example :
dotnet test --no-restore --verbosity normal -f netcoreapp2.1
Now the following exception is returned instead.
Testhost process exited with error: It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.1.0' was not found.
- The following frameworks were found:
3.1.9 at [C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\shared\Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.1.0&arch=x64&rid=win10-x64
. Please check the diagnostic logs for more information.
Build works fine and removing this action allows the test command to run as expected.
changed the title [-]Unable to test using target older frameworks following setup[/-][+]Unable to test using older target frameworks following setup[/+]on Oct 15, 2020
The framework 'Microsoft.NETCore.App', version '3.1.0' was not found.
- The following frameworks were found:
5.0.0 at [/home/runner/.dotnet/shared/Microsoft.NETCore.App]
The thing is the setup task installs dotnet to user' directory and add this directory to PATH, so all pre-installed dotnet versions stop working. You should use setup task twice to install both needed dotnet versions.
You can’t do that if multi targeting. If you install the lower target then your higher target won’t build. This used to all work then it didn’t, hence the issue.
I could have sworn with previous versions running multiple installs simply overwrote the path to the previous and continued to break things!
Anyway... If that works now that's fine by me. It's a shame that we have to do this now though since the syntax is clunky and it massively slows down build times.
I just want to say thanks for this solution. Been trying to get my tests back work the entire day and this seems to be the solution.
Still think it is a bit strange that you can build/run/test from the CLI using the latest available SDK to build/test every version below.
But it does not work the same way within the github action.
Activity
[-]Unable to test using target older frameworks following setup[/-][+]Unable to test using older target frameworks following setup[/+]changed tests to target .NET Core 2.0 to 3.0
changed tests to target .NET Core 3.1 instead of 2.0
changed tests to target .NET Core 3.0 instead of 2.0
Reduce noise from GitHub's unchanged files with check annotations fea…
pensono commentedon Nov 25, 2020
I have also encountered this.
Error:
vsafonkin commentedon Feb 10, 2021
Hi @JimBobSquarePants , is this issue still actual for you?
JimBobSquarePants commentedon Feb 10, 2021
The issue still exists. Here’s a run from my reproduction.
https://github.com/JimBobSquarePants/SetupDotNetActionFailRepro/runs/1872216853?check_suite_focus=true
vsafonkin commentedon Feb 10, 2021
The thing is the setup task installs dotnet to user' directory and add this directory to PATH, so all pre-installed dotnet versions stop working. You should use setup task twice to install both needed dotnet versions.
JimBobSquarePants commentedon Feb 10, 2021
You can’t do that if multi targeting. If you install the lower target then your higher target won’t build. This used to all work then it didn’t, hence the issue.
vsafonkin commentedon Feb 11, 2021
Why not? I mean, you should install all required versions explicitly:
https://github.com/vsafonkin/SetupDotNetActionFailRepro/actions/runs/557050694
JimBobSquarePants commentedon Feb 12, 2021
I could have sworn with previous versions running multiple installs simply overwrote the path to the previous and continued to break things!
Anyway... If that works now that's fine by me. It's a shame that we have to do this now though since the syntax is clunky and it massively slows down build times.
vsafonkin commentedon Feb 12, 2021
Most likely a second version of setup task which will be released which will install required dotnet to the directory with pre-installed versions.
JimBobSquarePants commentedon Feb 12, 2021
I'll close this for now then since there's a valid workaround. Thanks for your help!
visschersm commentedon Aug 24, 2021
I just want to say thanks for this solution. Been trying to get my tests back work the entire day and this seems to be the solution.
Still think it is a bit strange that you can build/run/test from the CLI using the latest available SDK to build/test every version below.
But it does not work the same way within the github action.