I'm not sure why this is posted under azure virtual machines. I receive the same error on my Apple M1
libhostfxr.dylib was found, but loading it from _tool/dotnet/host/fxr/7.0.10/libhostfxr.dylib failed
During command execution in Azure pipeline on Agent machine getting below error.
Agent machine : MacOS 13.1,M1 processor
Failed to load /Volumes/Ext/azure_agent/_work/_tool/dotnet/host/fxr/7.0.10/libhostfxr.dylib,
error: dlopen(/Volumes/Ext/azure_agent/_work/_tool/dotnet/host/fxr/7.0.10/libhostfxr.dylib, 0x0001): tried:
'/Volumes/Ext/azure_agent/_work/_tool/dotnet/host/fxr/7.0.10/libhostfxr.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')),
'/System/Volumes/Preboot/Cryptexes/OS/Volumes/Ext/azure_agent/_work/_tool/dotnet/host/fxr/7.0.10/libhostfxr.dylib' (no such file), '/Volumes/Ext/azure_agent/_work/_tool/dotnet/host/fxr/7.0.10/libhostfxr.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))The library libhostfxr.dylib was found, but loading it from /Volumes/Ext/azure_agent/_work/_tool/dotnet/host/fxr/7.0.10/libhostfxr.dylib failed