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 · 0 comments
Open

MSBuildWorkspace.OpenProjectAsync() does not load anything #73327

gamadori-osm opened this issue May 3, 2024 · 0 comments
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

1 participant