Skip to content

Support the .slnx Solution File Format in Roslynator CLI #1639

Open
@timozn

Description

@timozn

Microsoft introduced the new .slnx Solution File Format and since 9.0.200 it is officially supported.
https://devblogs.microsoft.com/dotnet/introducing-slnx-support-dotnet-cli/

However Roslynator CLI does not recognize .slnx as a Solution and therefore tries to open the Solution as a Project.

Loading project 'path-to-file/Solution.slnx'...
Error occurred while loading project 'path-to-file/Solution.slnx'
System.InvalidOperationException: Cannot open project 'path-to-file/Solution.slnx' because the file extension '.slnx' is not associated with a language.
   at Microsoft.CodeAnalysis.MSBuild.DiagnosticReporter.Report(DiagnosticReportingMode mode, String message, Func`2 createException)
   at Microsoft.CodeAnalysis.MSBuild.ProjectFileExtensionRegistry.TryGetLanguageNameFromProjectPath(String projectFilePath, DiagnosticReportingMode mode, String& languageName)
   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.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 246

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions