Closed arunchndr closed 1 year ago
Looks like this is an x64 mac (not arm). So the extension platform seems correct. My only guess is that the runtime download is either for the wrong platform or corrupt (cc @nagilson )
@pchalamet one request
/Users/pierre/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.9/dotnet
Note this should be mitigated by https://github.com/dotnet/vscode-csharp/pull/6074 which will pick up the dotnet 7 version listed on the path. Planned to be released this week.
Hello, sorry for the delay, I was on holidays.
/Users/pierre/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.10/dotnet
is not a folder, it's an app (with the upgrade, dotnet 7.0.10 is used - but 7.0.9 is same):
Also note this is really an x64 mac app:
Latest version of C# extension (v2.0.376) still fail with following error:
Failed to find dotnet info from path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime
Found dotnet version 7.0.9. Minimum required version is 7.0.100.
Dotnet path: /Users/pierre/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.10/dotnet
Activating C# standalone...
[Info - 10:30:26] [Program]Language server initialized
[Error - 10:30:26] [LanguageServerHost]System.DllNotFoundException: Unable to load shared library 'hostfxr' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable:
dlopen(/Users/pierre/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.10/shared/Microsoft.NETCore.App/7.0.10/hostfxr.dylib, 1): image not found
dlopen(/Users/pierre/.vscode/extensions/ms-dotnettools.csharp-2.0.376-darwin-x64/.roslyn/hostfxr.dylib, 1): image not found
dlopen(hostfxr.dylib, 1): image not found
dlopen(/Users/pierre/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.10/shared/Microsoft.NETCore.App/7.0.10/libhostfxr.dylib, 1): image not found
dlopen(/Users/pierre/.vscode/extensions/ms-dotnettools.csharp-2.0.376-darwin-x64/.roslyn/libhostfxr.dylib, 1): image not found
dlopen(libhostfxr.dylib, 1): image not found
dlopen(/Users/pierre/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.10/shared/Microsoft.NETCore.App/7.0.10/hostfxr, 1): image not found
dlopen(/Users/pierre/.vscode/extensions/ms-dotnettools.csharp-2.0.376-darwin-x64/.roslyn/hostfxr, 1): image not found
dlopen(hostfxr, 1): image not found
dlopen(/Users/pierre/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.10/shared/Microsoft.NETCore.App/7.0.10/libhostfxr, 1): image not found
dlopen(/Users/pierre/.vscode/extensions/ms-dotnettools.csharp-2.0.376-darwin-x64/.roslyn/libhostfxr, 1): image not found
dlopen(libhostfxr, 1): image not found
at Microsoft.Build.Locator.NativeMethods.hostfxr_resolve_sdk2(String exe_dir, String working_dir, hostfxr_resolve_sdk2_flags_t flags, hostfxr_resolve_sdk2_result_fn result)
at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetDotNetBasePaths(String workingDirectory)+MoveNext()
at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetInstances(String workingDirectory)+MoveNext()
at Microsoft.Build.Locator.MSBuildLocator.GetInstances(VisualStudioInstanceQueryOptions options)+MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LanguageServerProjectSystem.TryEnsureMSBuildLoadedAsync(String workingDirectory) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectSystem.cs:line 140
at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LanguageServerProjectSystem.OpenSolutionAsync(String solutionFilePath) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectSystem.cs:line 78
at Microsoft.CommonLanguageServerProtocol.Framework.QueueItem`3.StartRequestAsync(TRequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/QueueItem.cs:line 136
This is the workaround I use to make it work:
cp ~/Library/Application\ Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.10/host/fxr/7.0.10/libhostfxr.dylib ~/.vscode/extensions/ms-dotnettools.csharp-2.0.376-darwin-x64/.roslyn/
The issue was addressed in the scope of https://github.com/dotnet/msbuild/issues/9038
You can use the package with the fix https://www.nuget.org/packages/Microsoft.Build.Locator/1.6.1.
Thanks for the heads up! We'll need to update our server to consume this new version. I believe @jasonmalinowski was on point for that (if not let me know and I can do it). For now assigning this issue over.
From vscode-dotnettools created by pchalamet: microsoft/vscode-dotnettools#347
Describe the Issue
Switching to v2 release (both v2.0.320 & v2.0.328), this error appears in the C# output and nothing works:
Switching back to v1.26.0 fixes everything.
Steps To Reproduce
Expected Behavior
It works.
Environment Information
OS:
macOS Big Sur 11.7.9 (running on Intel)
Here some listings:
And dotnet info: