Details
-
Test
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
proton-dotnet-1.0.0-M1
-
None
Description
Running the tests can fail on system with only .Net 6 installed. This seems to be expected due to the build targeting 5.0.0, along with the default 'rollforward' policy handling being 'Minor', per https://docs.microsoft.com/en-us/dotnet/core/versions/selection#framework-dependent-apps-roll-forward.
This was observed on a Fedora 36 install, where running "./build.sh test" showed that the initial build completed, but then the test steps failed as only a 6.0.x install was found, e.g:
Starting test execution, please wait...
Testhost process exited with error: It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '5.0.0' (x64) was not found.
- The following frameworks were found:
6.0.5 at [/usr/lib64/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=5.0.0&arch=x64&rid=fedora.36-x64
. Please check the diagnostic logs for more information.
It was possible to pass properties to the dotnet build/test command to make the existing 1.0.0-M1 tests run successfully otherwise unaltered on F36, e.g:
dotnet build /property:DefaultUnitTestTargetFrameworks=net6.0 /property:DefaultExeTargetFrameworks=net6.0 dotnet test /property:DefaultUnitTestTargetFrameworks=net6.0 /property:DefaultExeTargetFrameworks=net6.0
It was also possible to get the tests running by updating them to add "<RollForward>LatestMajor</RollForward>" property config to the .csproj files (e.g see attached diff).