AiAssertions.Roslyn
0.2.2-rc.1
dotnet add package AiAssertions.Roslyn --version 0.2.2-rc.1
NuGet\Install-Package AiAssertions.Roslyn -Version 0.2.2-rc.1
<PackageReference Include="AiAssertions.Roslyn" Version="0.2.2-rc.1" />
<PackageVersion Include="AiAssertions.Roslyn" Version="0.2.2-rc.1" />
<PackageReference Include="AiAssertions.Roslyn" />
paket add AiAssertions.Roslyn --version 0.2.2-rc.1
#r "nuget: AiAssertions.Roslyn, 0.2.2-rc.1"
#:package AiAssertions.Roslyn@0.2.2-rc.1
#addin nuget:?package=AiAssertions.Roslyn&version=0.2.2-rc.1&prerelease
#tool nuget:?package=AiAssertions.Roslyn&version=0.2.2-rc.1&prerelease
AiAssertions.Roslyn
Roslyn-powered semantic navigation tools for AiAssertions codebase agents.
Installation
dotnet add package AiAssertions.Roslyn
Usage
Enable Roslyn tools for one assertion:
using AiAssertions.Roslyn;
var result = await AiAssert
.OnCodebase()
.WithRoslynTools()
.That("Every implementation of IPasswordStore hashes passwords before persisting them.");
Or enable them globally:
AiAssert
.Configure(modelClient)
.WithGlobalRoslynTools();
For repositories with multiple solutions or projects, select the workspace explicitly:
var result = await AiAssert
.OnCodebase()
.WithRoslynTools(options =>
options.WorkspacePath = "src/MyProduct.slnx")
.That("Every implementation of IPasswordStore hashes passwords before persisting them.");
WorkspacePath accepts a .slnx, .sln, or .csproj path inside the codebase root. When omitted, the package automatically discovers a workspace. The selected workspace is loaded lazily and reused for the assertion run.
Large or multi-targeted solutions can also select an exact source project and target framework:
var result = await AiAssert
.OnCodebase()
.WithRoslynTools(options =>
{
options.WorkspacePath = "src/MyProduct.slnx";
options.ProjectPath = "src/MyProduct/MyProduct.csproj";
options.TargetFramework = "net10.0";
})
.That("Every override of MessageHandler.HandleAsync preserves cancellation.");
ProjectPath distinguishes projects that have the same display name, such as ref and src projects. TargetFramework selects one multi-targeted variant. Navigation is scoped to the selected or declaring project and projects that transitively depend on it instead of scanning every document in the solution.
Roslyn runs in an isolated worker process by default. A compiler crash terminates the worker and is reported as a tool error without terminating the assertion process. IsolateProcess = false is available for controlled diagnostics, but is not recommended for normal test runs.
Tools
| Tool | Purpose |
|---|---|
resolve_symbol |
Resolves a C# type or member to an exact project-aware symbol_id. |
find_references |
Finds semantic source references to the resolved symbol. |
find_callers |
Finds symbols and source locations that call the resolved member. |
find_implementations |
Finds implementations of interfaces, interface members, and overridable members. |
WithRoslynTools() and WithGlobalRoslynTools() also append system instructions describing when and how the model should use these tools. e includes workspace health. workspace.status = "degraded" or results_complete = false means empty or exhaustive results must not be treated as proof until the project/TFM scope or workspace diagnostics are addressed.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- AiAssertions (>= 0.2.2-rc.1)
- Microsoft.Build.Locator (>= 1.11.2)
- Microsoft.CodeAnalysis.CSharp.Workspaces (>= 5.6.0)
- Microsoft.CodeAnalysis.Workspaces.MSBuild (>= 5.6.0)
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 |
|---|---|---|
| 0.2.2-rc.1 | 76 | 8/12/2026 |