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

MSBuildWorkspace.OpenProjectAsync() does not load anything #73327

Open
gamadori-osm opened this issue May 3, 2024 · 3 comments
Open

MSBuildWorkspace.OpenProjectAsync() does not load anything #73327

gamadori-osm opened this issue May 3, 2024 · 3 comments
Assignees
Labels
Milestone

Comments

@gamadori-osm
Copy link

Version Used: VS 17.9.6 Compiler version 4.9.0-3.24121.1 (a98c90d) .NET 8 C#12

Steps to Reproduce:

  1. Create a new project with the template VisualStudio.Extensibility Extension without VSSDK Compatibility
  2. In the Command1.cs file inside the ExecuteCommandAsync method try to open a project/solution, here's a sample
public override async Task ExecuteCommandAsync(IClientContext context, CancellationToken cancellationToken)
{
    try
    {
        // I've tried several versions, the behaviour does not change
        MSBuildLocator.RegisterDefaults();
        using var workspace = MSBuildWorkspace.Create();
        // Does not open the project neither returns some error
        var project = await workspace.OpenProjectAsync("{path to some project}");
    }
    catch (Exception ex)
    {
        Debug.WriteLine(ex.Message);
    }
}

Expected Behavior:
open the project or throw some error.
I don't know if what I am trying to do is possible or if it is the right way to do it but I would have expected at least an error of some kind.

Actual Behavior:
the process does not go on, it seems to go on an endless wait

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 3, 2024
@JoeRobich
Copy link
Member

This is likely another instance of #73854

@jasonmalinowski jasonmalinowski self-assigned this May 30, 2024
@jasonmalinowski jasonmalinowski removed the untriaged Issues and PRs which have not yet been triaged by a lead label May 30, 2024
@jasonmalinowski jasonmalinowski added this to the 17.11 milestone May 30, 2024
@jasonmalinowski
Copy link
Member

@JoeRobich I think this is the new extensibility model, so it would be something else (although possibility a similar root cause)

@gamadori-osm: if you attach an event handler for MSBuildWorkspace.WorkspaceFailed, is that event fired? Any failure absolutely should result in your task not waiting forever, but maybe we have multiple bugs.

@gamadori-osm
Copy link
Author

gamadori-osm commented Jun 6, 2024

@jasonmalinowski I've tried attaching an event handler but the behaviour does not change. The handler is never fired.

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

3 participants