Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
wgnf committed Sep 12, 2021
1 parent c488a97 commit 03d622d
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,45 @@
# SlnParser
Parses your Solution (.sln) File

[![Latest Release](https://img.shields.io/nuget/v/SlnParser?style=for-the-badge)](https://www.nuget.org/packages/SlnParser/)
[![Downloads](https://img.shields.io/nuget/dt/SlnParser?style=for-the-badge)](https://www.nuget.org/packages/SlnParser/)

.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.

## Usage

### Parsing

```cs

var parser = new SolutionParser();
var parsedSolution = parser.Parse("path/to/your/solution.sln");

```

### Accessing the projects

```cs

// 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);

```

## Help me

The current list of [project types](src/Contracts/../SlnParser/Contracts/ProjectType.cs) is not yet **complete**.

If you encounter any Projects where the `Type` is `ProjectType.Unknown` and you know for sure which project type that is (providing an example would be best) create an _Issue_ providing the `TypeGuid` and what kind of project that is. Thanks! 😊

0 comments on commit 03d622d

Please sign in to comment.