Solution.Parser
3.0.0
See the version list below for details.
dotnet add package Solution.Parser --version 3.0.0
NuGet\Install-Package Solution.Parser -Version 3.0.0
<PackageReference Include="Solution.Parser" Version="3.0.0" />
<PackageVersion Include="Solution.Parser" Version="3.0.0" />
<PackageReference Include="Solution.Parser" />
paket add Solution.Parser --version 3.0.0
#r "nuget: Solution.Parser, 3.0.0"
#:package Solution.Parser@3.0.0
#addin nuget:?package=Solution.Parser&version=3.0.0
#tool nuget:?package=Solution.Parser&version=3.0.0
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. |
-
net9.0
- Extensions.Pack (>= 6.0.1)
- FileSystem.Abstraction (>= 0.1.2)
- Microsoft.Build (>= 17.12.6)
- Microsoft.CodeAnalysis.CSharp (>= 4.11.0)
- NuGet.Configuration (>= 6.12.1)
- NuGet.Versioning (>= 6.12.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Solution.Parser:
| Package | Downloads |
|---|---|
|
Siemens.AspNet.CodeRules.Contracts
Everything a code rule author needs: IRule, ICodeRule, ISolutionRule, Finding, CodeContext, SolutionContext and ICodeRulePack. A rule pack references only this package, never the engine or a test framework. Ships the descriptor source generator. |
|
|
Siemens.AspNet.CodeRules.Engine
The code rule engine: registers rules with AddCodeRuleEngine, parses the solution once, runs the rules and reports findings (human or AI JSON). Includes ICodeRuleSetup for test projects and RuleTester for unit tests of single rules. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 6.1.4 | 276 | 11/12/2026 |
| 6.1.3 | 4,225 | 11/4/2026 |
| 6.1.2 | 42 | 11/4/2026 |
| 6.1.1 | 776 | 11/4/2026 |
| 6.1.0 | 1,365 | 11/2/2026 |
| 6.0.2 | 8,399 | 10/13/2026 |
| 6.0.1 | 48 | 10/13/2026 |
| 6.0.0 | 48 | 10/13/2026 |
| 5.1.0-alpha.11 | 74 | 10/8/2026 |
| 5.1.0-alpha.7 | 70 | 10/8/2026 |
| 5.0.2 | 1,424 | 10/8/2026 |
| 5.0.1 | 2,591 | 9/27/2026 |
| 5.0.0 | 63 | 9/24/2026 |
| 5.0.0-alpha.8 | 74 | 9/22/2026 |
| 4.0.0 | 47,292 | 4/8/2026 |
| 4.0.0-alpha.17 | 82 | 9/15/2026 |
| 4.0.0-alpha.12 | 271 | 3/24/2026 |
| 3.0.8 | 13,878 | 1/9/2026 |
| 3.0.7 | 4,327 | 11/23/2025 |
| 3.0.0 | 13,682 | 11/20/2024 |
Upgrade to .Net 9