🛠️ .NET: Easy (to use) Parser for your .NET Solution (.sln) Files. This project targets netstandard2.0
so it can basically be used anywhere you want. I've not yet run any performance tests.
var parser = new SolutionParser();
var parsedSolution = parser.Parse("path/to/your/solution.sln");
// gives you a flat list of all the Projects/Solution-Folders in your Solution
var flat = parsedSolution.AllProjects;
// gives you a structured (Solution-Folders containing projects) of all the Projects/Solution-Folders in your solution
var structured = parsedSolution.Projects;
// this'll give you all the projects that are not a Solution-Folder
var noFolders = parsedSolution
.AllProjects
.OfType<SolutionProject>();
// this'll give you all the projects of the desired type (C# class libs in this case)
var csharpProjects = parsedSolution
.AllProjects
.Where(project => project.Type == ProjectType.CSharpClassLibrary);
To develop and work with SlnParser you just need to clone this Repo somewhere on your PC and then open the Solution or the complete Source-Folder (under src
) with your favorite IDE. No additional tools required.
Before you can start, you should restore all NuGet-Packages using dotnet restore
if that's not done for you by your IDE.
Cool! We're always welcoming anyone that wants to contribute to this project! Take a look at the Contributing Guidelines, which helps you get started. You can also look at the Open Issues for getting more info about current or upcoming tasks.
If you have any questions, doubts, ideas, problems or you simply want to present your opinions and views, feel free to hop into Discussions and write about what you care about. We'd love to hear from you!