Mac VSCode C# Dev Kit 停止编译我的代码

Mac VSCode C# Dev Kit stopped compiling my code

提问人:Corey 提问时间:10/28/2023 最后编辑:Corey 更新时间:10/28/2023 访问量:51

问:

我已经在我的代码库上工作了几个月,一切都很好。今天,VSCode 刚刚停止编译它。F12 找不到任何内容的定义。我猜我的一个扩展更新了。

我能找到的唯一提示是在选项卡下,因为:OUTPUTC# Dev Kit

Starting Spawn .NET server...
Starting Open a solution...
Starting Open a solution with environment service...
Starting Clear environment...
.NET server STDERR: Failed to load /Users/corey/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.13~x64/host/fxr/7.0.13/libhostfxr.dylib, error: dlopen(/Users/corey/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.13~x64/host/fxr/7.0.13/libhostfxr.dylib, 0x0001): tried: '/Users/corey/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.13~x64/host/fxr/7.0.13/libhostfxr.dylib' (code signature in <CBC551D2-1B48-36B4-BA7F-FC8A24B39EC7> '/Users/corey/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.13~x64/host/fxr/7.0.13/libhostfxr.dylib' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)), '/System/Volumes/Preboot/Cryptexes/OS/Users/corey/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.13~x64/host/fxr/7.0.13/libhostfxr.dylib' (no such file), '/Users/corey/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.13~x64/host/fxr/7.0.13/libhostfxr.dylib' (code signature in <CBC551D2-1B48-36B4-BA7F-FC8A24B39EC7> '/Users/corey/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.13~x64/host/fxr/7.0.13/libhostfxr.dylib' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?))
The library libhostfxr.dylib was found, but loading it from /Users/corey/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.13~x64/host/fxr/7.0.13/libhostfxr.dylib failed
  - Installing .NET prerequisites might help resolve this problem.
     https://go.microsoft.com/fwlink/?linkid=2063366

.NET server exited with 130

我已经尝试重新启动 VSCode 很多次了。我已经按照错误消息的建议重新安装了 dotnet sdk。该文件确实存在。我的处理器是 .我已经按照这里的建议尝试了,但这没有任何改变。dotnet-sdk-7.0.403-osx-x64.pkg/Users/corey/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.13~x64/host/fxr/7.0.13/libhostfxr.dylib2 GHz Quad-Core Intel Core i5Preferences > Settings > Omnisharp > Toggling on 'Dotnet>Server: Use Omnisharp'

错误消息的关键部分似乎是 Microsoft 是否没有正确签署他们的库或其他东西?我应该以某种方式签署这个吗?两天前一切正常。我感到困惑和沮丧。任何帮助都是值得赞赏的。libhostfxr.dylib' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?))

visual-studio-code c#-7.0 dotnet-sdk

评论

0赞 Mikolaj 11/7/2023
我面临同样的错误。您是否已将 MacOS 更新到 MacOS 14 Sonoma?
0赞 crass_sandwich 11/8/2023
我遇到了类似的问题,但间歇性地。通常重新启动(即退出并重新打开)VSCode 会有所帮助
0赞 Corey 11/9/2023
在此处查看更多信息: github.com/microsoft/vscode-dotnettools/issues/664 那里的解决方案对我不起作用,我最终只是卸载了 C# 开发工具包扩展。:(

答: 暂无答案