-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! 😊 |