Solution.Parser
3.0.8
This package has a SemVer 2.0.0 package version: 3.0.8+1.
dotnet add package Solution.Parser --version 3.0.8
NuGet\Install-Package Solution.Parser -Version 3.0.8
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Solution.Parser" Version="3.0.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Solution.Parser" Version="3.0.8" />
<PackageReference Include="Solution.Parser" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Solution.Parser --version 3.0.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Solution.Parser, 3.0.8"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Solution.Parser@3.0.8
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Solution.Parser&version=3.0.8
#tool nuget:?package=Solution.Parser&version=3.0.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Solution Parser
Sample
[TestClass]
public abstract class MsTestBase
{
protected static IImmutableList<CSharpSyntaxTree> TestCode { get; private set; } = ImmutableList<CSharpSyntaxTree>.Empty;
protected static IImmutableList<CSharpSyntaxTree> AllSyntaxTrees { get; private set; } = ImmutableList<CSharpSyntaxTree>.Empty;
protected static IImmutableList<CSharpSyntaxTree> ProductiveCode { get; private set; } = ImmutableList<CSharpSyntaxTree>.Empty;
protected static IImmutableList<CSharpSyntaxTree> ProductiveCodeToAnaylze { get; private set; } = ImmutableList<CSharpSyntaxTree>.Empty;
protected static SolutionFile Solution { get; private set; } = null!;
[AssemblyInitialize]
public static void Init(TestContext _)
{
var sSolutionFileInfo = new SolutionFileName("MySolution.sln").FindSolutionFileReverseFrom(new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory));
Throw.IfNull(sSolutionFileInfo);
Solution = sSolutionFileInfo.Parse();
ProductiveCode = Solution.ProductiveProjects.SelectMany(p => p.CSharpFileInfos)
.Select(c => c.Parse())
.ToImmutableList();
TestCode = Solution.UnitTestProjects.SelectMany(p => p.CSharpFileInfos)
.Select(c => c.Parse())
.ToImmutableList();
AllSyntaxTrees = ProductiveCode.Concat(TestCode).ToImmutableList();
}
}
CodeRule sample
[TestCategory("Coding-Rules")]
[TestCategory("Coding-Rules Records")]
[TestClass]
public class Records : MsTestBase // <-- MsTestBase is a base class that provides the ProductiveCode property
{
[TestMethod]
public void Record_Properties_Have_To_Be_Be_Immutable()
{
var mutableProperties = (from syntaxTree in ProductiveCode
from @record in syntaxTree.Records
from property in @record.Properties
where property.IsReadOnly.IsFalse()
select new
{
Error = $@"
Please do not use mutable properties
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FullName: {@record.FullQualifiedName}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Property: {property.Type} {property.Name}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Should be: {property.Type} {{get; init;}}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
"
}).ToImmutableList();
Assert.IsTrue(mutableProperties.IsEmpty(),
$"Properties must be immutable. Findings: '{mutableProperties.Count}':{Environment.NewLine}{mutableProperties.Select(error => error.Error).Flatten(Environment.NewLine)}{Environment.NewLine}");
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Extensions.Pack (>= 6.0.16)
- FileSystem.Abstraction (>= 0.1.2)
- Microsoft.Build (>= 17.14.28)
- Microsoft.CodeAnalysis.CSharp (>= 5.0.0)
- NuGet.Configuration (>= 7.0.1)
- NuGet.Versioning (>= 7.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.8 | 455 | 1/9/2026 |
| 3.0.7 | 3,579 | 11/23/2025 |
| 3.0.6 | 221 | 11/21/2025 |
| 3.0.5 | 3,692 | 10/29/2025 |
| 3.0.4 | 34,624 | 9/8/2025 |
| 3.0.3 | 404 | 9/7/2025 |
| 3.0.2 | 14,579 | 2/4/2025 |
| 3.0.1 | 10,716 | 1/24/2025 |
| 3.0.0 | 12,233 | 11/20/2024 |
| 2.0.18 | 108,581 | 11/20/2024 |
| 2.0.17 | 11,828 | 10/17/2024 |
| 2.0.16 | 47,856 | 9/23/2024 |
| 2.0.15 | 4,422 | 9/6/2024 |
| 2.0.13 | 14,360 | 6/12/2024 |
| 2.0.12 | 4,001 | 5/26/2024 |
| 2.0.11 | 4,942 | 5/12/2024 |
| 2.0.10 | 3,933 | 5/12/2024 |
| 2.0.9 | 3,951 | 5/10/2024 |
| 2.0.8 | 3,934 | 5/9/2024 |
| 2.0.7 | 3,963 | 5/9/2024 |
| 2.0.6 | 3,942 | 5/9/2024 |
| 2.0.5 | 6,033 | 4/20/2024 |
| 2.0.4 | 5,286 | 3/5/2024 |
| 2.0.3 | 6,779 | 1/22/2024 |
| 2.0.2 | 3,937 | 1/22/2024 |
| 2.0.1 | 4,308 | 1/16/2024 |
| 2.0.0 | 9,536 | 11/28/2023 |
| 0.2.0 | 3,710 | 11/28/2023 |
| 0.2.0-alpha.45 | 481 | 10/14/2023 |
| 0.2.0-alpha.44 | 197 | 9/12/2023 |
| 0.2.0-alpha.43 | 1,744 | 8/28/2023 |
| 0.2.0-alpha.42 | 181 | 8/27/2023 |
| 0.2.0-alpha.41 | 195 | 8/27/2023 |
| 0.2.0-alpha.38 | 1,464 | 7/25/2023 |
| 0.2.0-alpha.37 | 531 | 6/30/2023 |
| 0.2.0-alpha.34 | 4,982 | 3/16/2023 |
| 0.2.0-alpha.31 | 873 | 2/5/2023 |
| 0.2.0-alpha.30 | 2,488 | 1/2/2023 |
| 0.2.0-alpha.29 | 248 | 1/1/2023 |
| 0.2.0-alpha.27 | 239 | 1/1/2023 |
| 0.2.0-alpha.25 | 241 | 1/1/2023 |
| 0.1.0-alpha.24 | 247 | 12/27/2022 |
| 0.1.0-alpha.23 | 493 | 12/12/2022 |
| 0.1.0-alpha.22 | 210 | 12/12/2022 |
| 0.1.0-alpha.21 | 5,152 | 9/15/2022 |
| 0.1.0-alpha.19 | 318 | 9/14/2022 |
| 0.1.0-alpha.16 | 2,634 | 6/7/2022 |
| 0.1.0-alpha.15 | 272 | 6/7/2022 |
| 0.1.0-alpha.14 | 275 | 6/7/2022 |
| 0.1.0-alpha.13 | 492 | 4/25/2022 |
| 0.1.0-alpha.12 | 258 | 4/22/2022 |
| 0.1.0-alpha.11 | 288 | 4/16/2022 |
Upgrade to .Net 9