Zaria.Calabash.DevHost 2.6.7

dotnet add package Zaria.Calabash.DevHost --version 2.6.7
                    
NuGet\Install-Package Zaria.Calabash.DevHost -Version 2.6.7
                    
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="Zaria.Calabash.DevHost" Version="2.6.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zaria.Calabash.DevHost" Version="2.6.7" />
                    
Directory.Packages.props
<PackageReference Include="Zaria.Calabash.DevHost" />
                    
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 Zaria.Calabash.DevHost --version 2.6.7
                    
#r "nuget: Zaria.Calabash.DevHost, 2.6.7"
                    
#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 Zaria.Calabash.DevHost@2.6.7
                    
#: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=Zaria.Calabash.DevHost&version=2.6.7
                    
Install as a Cake Addin
#tool nuget:?package=Zaria.Calabash.DevHost&version=2.6.7
                    
Install as a Cake Tool

Instructions

Version 2.0.0

=========================== In the latest build the individual Startxxxx methods have been consolidated into one method that will start the dev hosting environment as a Blazor app. While it can techically be started from a console, you will need to configure the project SDK as a web project Microsoft.NET.Sdk.Web.
The following code demonstrates using it in this way

var configuration = new ConfigurationBuilder()
                    .SetBasePath(AppContext.BaseDirectory)
                    .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
                    .AddEnvironmentVariables()
                    .AddCommandLine(args)
                    .Build();

var host = new CalabashDevHost();
await host.InitializeAI<SampleHost>(new HostSettings
{
    AIDeploymentName = "<The deployment name>",
    AIEndpoint = "<The AI endpoing>",
    AIKey = "<The AI key>",
    LogCategory = "<A string for the log category you want>",
    Username = "<anything you want to tbe passed as the username>",
    BasePath = "api",
    Configuration = builder.Configuration,
    SessionID = <A guid to represent the session id>,
    Profile = new Zaria.Calabash.Data.UserProfile
    {
        User = new Zaria.Calabash.Data.User
        {
            FirstName = "<Anything you want to be passed as the first name>",
            LastName = "<Anything you want to be passed as the last name>",
        },
        EffectiveRoles = "<The roles you want to emulate>"
    },
});

host.StartCalabashHost();

Note that to get this to work properly you will have to add a blank .razor file to the console project. This file does not need to contain anything but is needed to properly run the devhost.

A much better approach is to simply create a new blazor application and use it as the devhost. The following steps demonstrate the approach.

  1. Create a blazor application
  2. Add a reference to this nuget package
  3. Delete the wwwroot and any blazor related items like the Components folder from the project. Leave Program.cs and appsettings.json
  4. Reference the calabash .NET plugin you want to test
  5. In Program.cs remove all the blazor configuration boilerplate except for var builder = WebApplication.CreateBuilder(args);
  6. Now add the following code
// Add services to the container.
await builder.RunCalabash<SampleHost>(new HostSettings
{
    AIDeploymentName = "<The deployment name>",
    AIEndpoint = "<The AI endpoing>",
    AIKey = "<The AI key>",
    LogCategory = "<A string for the log category you want>",
    Username = "<anything you want to tbe passed as the username>",
    BasePath = "api",
    Configuration = builder.Configuration,
    SessionID = <A guid to represent the session id>,
    Profile = new Zaria.Calabash.Data.UserProfile
    {
        User = new Zaria.Calabash.Data.User
        {
            FirstName = "<Anything you want to be passed as the first name>",
            LastName = "<Anything you want to be passed as the last name>",
        },
        EffectiveRoles = "<The roles you want to emulate>"
    },
});

SampleHost here represents the SolutionHost from the plugin library. This method allows you to test all scenarios in a real world manner. A web page is opened that points to an isolated instance of Calabash. You have access to the chatbox in the Calabash dashboard, your time triggered jobs run as background workers, and your http triggered workers can be called via rest.

Version 1.*

===========================

To use this dev host do th following:

  1. Create a console applicaiton
  2. Reference the calabash .NET plugin you want to test
  3. Create a new instance of the CalabashDevHost class
  4. Call InitializeAI passing in a class that inherits from SolutionHost as the type argument and a populated HostSettings argument
  5. Call StartREPL to start a REPL loop for testing your AI skills
  6. To test your HTTP triggers you can alternatively call StartHTTP
  7. To test your time triggered workers you can alternatively call StartBackgroundWorker

The following sample code illustrates:

namespace Calabash.AgentTestHarness
{
    internal class Program
    {
        async static Task Main(string[] args)
        {
            var host = new CalabashDevHost();
            await host.InitializeAI<SampleHost>(new HostSettings
            {
                AIDeploymentName = "<ai deployment name>",
                AIEndpoint = "<ai url>",
                AIKey = "<ai key>",
                LogCategory = "test",
                Username = "<some email>",
                HttpListenPort = 5000,
                BasePath = "/api",
            });

            //await host.StartHTTP();  //Starts an http listener that can be used to test your http triggers
            //await host.StartREPL();  //Starts a console repl for testing your AI skills
            //await host.StartBackgroundWorker();  //Starts background workers for testing your time triggers. 
        }
    }
}
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
2.6.7 0 5/18/2026
2.6.6 0 5/18/2026
2.6.5 0 5/18/2026
1.0.9 99 4/25/2026
1.0.7 97 4/24/2026
1.0.6 88 4/24/2026
1.0.5 98 4/24/2026
1.0.4 90 4/24/2026
1.0.3 87 4/21/2026
1.0.2 88 4/21/2026
1.0.1 87 4/20/2026
1.0.0 90 4/20/2026