Skip to content

M1 Mac cannot find libhostfxr.dylib #21187

Open
@abist

Description

@abist

Describe the bug

I'm trying to port an app from .NET 5 to .NET 6 to support M1 Macs. I could build and publish the project fine, but when I start the app, I get the following error -

Failed to load 
 azuredatastudio/extensions/mssql/sqltoolsservice/OSX/3.0.0-release.129/libhostfxr.dylib, error: dlopen(azuredatastudio/extensions/mssql/sqltoolsservice/OSX/3.0.0-release.129/libhostfxr.dylib, 1): no suitable image found.  Did find:
 azuredatastudio/extensions/mssql/sqltoolsservice/OSX/3.0.0-release.129/libhostfxr.dylib: mach-o, but wrong architecture
 azuredatastudio/extensions/mssql/sqltoolsservice/OSX/3.0.0-release.129/libhostfxr.dylib: mach-o, but wrong architecture
The library libhostfxr.dylib was found, but loading it from 
 azuredatastudio/extensions/mssql/sqltoolsservice/OSX/3.0.0-release.129/libhostfxr.dylib failed
  - Installing .NET prerequisites might help resolve this problem.
     https://go.microsoft.com/fwlink/?linkid=2063366

I saw other similar issues, where this issue occurs when loading .NET 5 and 6 side by side, but I only have .NET 6 on this M1 machine.

To Reproduce

Exceptions (if any)

Further technical details

  • Include the output of dotnet --info
 .NET SDK (reflecting any global.json):
 Version:   6.0.100-rc.1.21458.32
 Commit:    d7c22323c4

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  11.6
 OS Platform: Darwin
 RID:         osx.11.0-arm64
 Base Path:   /usr/local/share/dotnet/sdk/6.0.100-rc.1.21458.32/

Host (useful for support):
  Version: 6.0.0-rc.1.21451.13
  Commit:  d7619cd4b1

.NET SDKs installed:
  6.0.100-rc.1.21458.32 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.0-rc.1.21452.15 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version - VS Code for Mac (ARM64) - Big Sur 11.6
  • Result of running dotnet --list-sdks - 6.0.100-rc.1.21458.32 [/usr/local/share/dotnet/sdk]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions