Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-2560

Running tests or examples can fail on system with only .NET 6 installed

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • proton-dotnet-1.0.0-M1
    • proton-dotnet-1.0.0-M2
    • proton-dotnet
    • 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.

      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).

      Attachments

        1. dotnet-build.diff
          2 kB
          Robbie Gemmell

        Activity

          People

            tabish Timothy A. Bish
            robbie Robbie Gemmell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: