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 cannot load Solution Filter .slnf #73105

Closed
boop5 opened this issue Apr 19, 2024 · 1 comment
Closed

MSBuildWorkspace.OpenProjectAsync cannot load Solution Filter .slnf #73105

boop5 opened this issue Apr 19, 2024 · 1 comment
Assignees
Labels
Area-IDE Feature Request help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Milestone

Comments

@boop5
Copy link

boop5 commented Apr 19, 2024

Version Used:

$ dotnet --list-sdks
7.0.203 [C:\Program Files\dotnet\sdk]
8.0.101 [C:\Program Files\dotnet\sdk]
8.0.204 [C:\Program Files\dotnet\sdk]

$ dotnet --version
8.0.204

Steps to Reproduce:

Try to load a Solution Filter with Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.OpenProjectAsync

Expected Behavior:

You can load Solution Filters

Actual Behavior:

You can not load Solution Filters, OpenProjectAsync throws an exception

StackTrace

This came up while I wanted to use roslynator but it seems to be a bug within roslyn though.

I've opened an issue on dotnet/roslynator #1431

The exception message is in de-DE and means: Project "somefilter.slnf" can't be opened, the file extension ".slnf" can't be matched to any language.

Error occurred while loading project 'somefilter.slnf'
System.InvalidOperationException: Projekt "somefilter.slnf" kann nicht geöffnet werden, da die Dateierweiterung ".slnf" keiner Sprache zugeordnet ist.
   at Microsoft.CodeAnalysis.MSBuild.DiagnosticReporter.Report(DiagnosticReportingMode mode, String message, Func`2 createException)
   at Microsoft.CodeAnalysis.MSBuild.ProjectFileLoaderRegistry.TryGetLoaderFromProjectPath(String projectFilePath, DiagnosticReportingMode mode, IProjectFileLoader& loader)
   at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.LoadProjectFileInfosAsync(String projectPath, DiagnosticReportingOptions reportingOptions, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.LoadProjectInfosFromPathAsync(String projectPath, DiagnosticReportingOptions reportingOptions, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.LoadAsync(CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.LoadProjectInfoAsync(String projectFilePath, ProjectMap projectMap, IProgress`1 progress, ILogger msbuildLogger, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.OpenProjectAsync(String projectFilePath, ILogger msbuildLogger, IProgress`1 progress, CancellationToken cancellationToken)
   at Roslynator.CommandLine.MSBuildWorkspaceCommand`1.OpenProjectOrSolutionAsync(String path, MSBuildWorkspace workspace, IProgress`1 progress, CancellationToken cancellationToken) in /_/src/CommandLine/Commands/MSBuildWorkspaceCommand.cs:line 242
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 19, 2024
@arunchndr arunchndr added Feature Request and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 19, 2024
@arunchndr arunchndr added this to the Backlog milestone Apr 19, 2024
@arunchndr arunchndr added the help wanted The issue is "up for grabs" - add a comment if you are interested in working on it label Apr 19, 2024
@JoeRobich
Copy link
Member

@boop5 You should be able to open solution filters (*.slnf) using MSBuildWorkspace.OpenSolutionAsync (Implemented in #51782).

Please reopen this issue if you are still having issues when using OpenSolutionAsync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Feature Request help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Projects
None yet
Development

No branches or pull requests

4 participants