AiAssertions.Roslyn 0.2.2-rc.1

This is a prerelease version of AiAssertions.Roslyn.
dotnet add package AiAssertions.Roslyn --version 0.2.2-rc.1
                    
NuGet\Install-Package AiAssertions.Roslyn -Version 0.2.2-rc.1
                    
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="AiAssertions.Roslyn" Version="0.2.2-rc.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AiAssertions.Roslyn" Version="0.2.2-rc.1" />
                    
Directory.Packages.props
<PackageReference Include="AiAssertions.Roslyn" />
                    
Project file
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 AiAssertions.Roslyn --version 0.2.2-rc.1
                    
#r "nuget: AiAssertions.Roslyn, 0.2.2-rc.1"
                    
#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 AiAssertions.Roslyn@0.2.2-rc.1
                    
#: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=AiAssertions.Roslyn&version=0.2.2-rc.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=AiAssertions.Roslyn&version=0.2.2-rc.1&prerelease
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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