Closed aimenux closed 1 year ago
Hi,
Thanks for reporting an interesting issue.
This GitHub Action is docker-based, and in the latest version uses the Microsoft base image mcr.microsoft.com/dotnet/sdk:7.0
to provide the DotNet SDK.
As you discovered, for some reason the dotnet test
command (when used in a container based on that 7.0 image) doesn't seem able to execute tests against a net6.0 target. The dotnet build
command (that is issued right before within this action) works fine though for net6.0.
Docker-based Actions are self-contained, and adding "actions/setup-dotnet" in previous workflow steps won't affect the capabilities of this action.
A workaround would be to run the tests only for the net7.0 target by setting -f net7.0
option in the action parameter dotnetTestArguments
in your workflow.
The problem (as I understand it) doesn't seem related specifically to multi-targeting, but rather not being able to run net6.0 tests from net7.0 Microsoft Docker base image.
Thanks @highbyte for your response, I already fixed my pipeline with the -f option.
Hi,
I m trying to use sonarscan-dotnet in a project targetting both .net 6 and .net 7 but i m getting this error :
I have 2 jobs in my yaml file :
The job1 is passing without any errors about some missing sdk but the job2 using sonarscan-dotnet is failling.
Do you have any idea please how to fix the issue and enable the scan of a project with multi targets ?
Thanks in advance.