Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in 【MSBuildWorkspace.Create() .OpenSolutionAsync()】:System.Exception (cannotfound BuildHost) #74070

Open
Miltomo opened this issue Jun 20, 2024 · 1 comment
Assignees
Labels

Comments

@Miltomo
Copy link

Miltomo commented Jun 20, 2024

Version Used: 17.11.0 Preview 2.1

Error Message:
Unable to find build host in “c:\program files\microsoft visual studio\2022\preview\common7\ide\commonextensions\microsoft\vbcsharp\languageservices\BuildHost-netcore\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.dll”

Steps to Reproduce:

  1. I am developing VS extensions 【VSIX Project】
  2. I'm just using Microsoft.CodeAnalysis.MSBuild to get a Solution var
  3. I have tried many methods (such as using Locator to register, but in reality, Locator will report an error saying that an instance already exists), but this error still occurs
  4. In fact, I checked the folder and found that the "BuildHost-netcore" folder does not exist under ..\Commonextensions\Microsoft\VBCSharp\LanguageServices
  5. Annoying BuildHost, annoying bad code, I think I have known why no one want to develop VS extensions

StackTrace:
在 Microsoft.CodeAnalysis.MSBuild.BuildHostProcessManager.AssertBuildHostExists(String buildHostPath)
在 Microsoft.CodeAnalysis.MSBuild.BuildHostProcessManager.GetNetCoreBuildHostPath()
在 Microsoft.CodeAnalysis.MSBuild.BuildHostProcessManager.CreateDotNetCoreBuildHostStartInfo()
在 Microsoft.CodeAnalysis.MSBuild.BuildHostProcessManager.d__9.MoveNext()
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 Microsoft.CodeAnalysis.MSBuild.BuildHostProcessManager.d__8.MoveNext()
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.d__20.MoveNext()
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.d__21.MoveNext()
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.d__19.MoveNext()
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.d__23.MoveNext()
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.d__23.MoveNext()
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.d__25.MoveNext()
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

Version Info:
C:\Users\Administrator>dotnet --info
.NET SDK:
Version: 8.0.302
Commit: ef14e02af8
Workload version: 8.0.300-manifests.c3d67e2f
MSBuild version: 17.10.4+10fbfbf2e

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 20, 2024
@kamronbatman
Copy link

Yeah I am getting the same error. This seems to be a combination of the bump to 4.9.0 or 4.10.0, and 8.0.302.
On my CI/CD (Azure Pipelines, newest windows and .NET 8.0.302), it never finishes finding the solution and the program hangs indefinitely.

@Cosifne Cosifne added LSP issues related to the roslyn language server protocol implementation and removed untriaged Issues and PRs which have not yet been triaged by a lead LSP issues related to the roslyn language server protocol implementation labels Jul 1, 2024
@Cosifne Cosifne assigned tmat and unassigned dibarbet Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants