Compatibility error because Mac M1 - while running SONAR Cloud for .Net Platform (C#)

Following are the details:

  • ALM used (Gitlab)
  • CI system used (Gitlab)
  • Scanner command used when applicable:
dotnet sonarscanner begin \
  /o:centralpoint \
  /k:centralpoint.io_order-usecase \
  /d:sonar.host.url=https://sonarcloud.io
<insert_your_build_command>
dotnet sonarscanner end
  • Languages of the repository (C#)

Following error is thrown:

Failed to load /opt/homebrew/Cellar/dotnet/8.0.4/libexec/host/fxr/8.0.4/libhostfxr.dylib, error: dlopen(/opt/homebrew/Cellar/dotnet/8.0.4/libexec/host/fxr/8.0.4/libhostfxr.dylib, 0x0001): tried: '/opt/homebrew/Cellar/dotnet/8.0.4/libexec/host/fxr/8.0.4/libhostfxr.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/dotnet/8.0.4/libexec/host/fxr/8.0.4/libhostfxr.dylib' (no such file), '/opt/homebrew/Cellar/dotnet/8.0.4/libexec/host/fxr/8.0.4/libhostfxr.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
The library libhostfxr.dylib was found, but loading it from /opt/homebrew/Cellar/dotnet/8.0.4/libexec/host/fxr/8.0.4/libhostfxr.dylib failed
  - Installing .NET prerequisites might help resolve this problem.

Hi,

Can you try this on a non-arm64 build agent?

 
Ann

You mean on a laptop with Intel chip?

Hi,

I guess you’re saying you don’t have any non-arm64 build agents for your .NET projects?

 
Ann