我正在关注.NET的教程
https://www.microsoft.com/net/learn/get-started/macos
我安装了.NET SDK并通过在macOS High Sierra版本10.13.5上使用创建了一个应用程序:
~$ dotnet new console -o myApp
这给我一个错误:
The template "Console Application" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on myApp/myApp.csproj...
Unable to load shared library 'libproc' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES
environment variable: dlopen(liblibproc, 1): image not found
我试着做
export DYLD_PRINT_LIBRARIES=/usr/lib/
在删除创建的文件夹和文件之前,我得到了很多打印的语句,如下所示:
dyld: loaded: /usr/local/share/dotnet/shared/Microsoft.NETCore.App/2.1.1/System.IO.Compression.Native.dylib
以及相同的错误:
The template "Console Application" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on myApp/myApp.csproj...
Unable to load shared library 'libproc' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES
environment variable: dlopen(liblibproc, 1): image not found
最佳答案
我通过使用fs-usage检查dotnet在哪里尝试找到libproc.dylib使其工作。就我而言,我发现dotnet试图在〜/ libproc.dylib中找到libproc.dylib,因此我将/usr/lib/libproc.dylib复制到〜/ libproc.dylib,dotnet正常工作。
我认为这不是一个令人满意的答案,因此,如果有人知道为什么dotnet不在/usr/lib/libproc.dylib中寻找libproc.dylib,请帮帮我。谢谢!