NickSoftware.Switchboard.Analyzers 0.1.0-preview.51

This is a prerelease version of NickSoftware.Switchboard.Analyzers.
This package has a SemVer 2.0.0 package version: 0.1.0-preview.51+eaef2e7.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package NickSoftware.Switchboard.Analyzers --version 0.1.0-preview.51
                    
NuGet\Install-Package NickSoftware.Switchboard.Analyzers -Version 0.1.0-preview.51
                    
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="NickSoftware.Switchboard.Analyzers" Version="0.1.0-preview.51">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NickSoftware.Switchboard.Analyzers" Version="0.1.0-preview.51" />
                    
Directory.Packages.props
<PackageReference Include="NickSoftware.Switchboard.Analyzers">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 NickSoftware.Switchboard.Analyzers --version 0.1.0-preview.51
                    
#r "nuget: NickSoftware.Switchboard.Analyzers, 0.1.0-preview.51"
                    
#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 NickSoftware.Switchboard.Analyzers@0.1.0-preview.51
                    
#: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=NickSoftware.Switchboard.Analyzers&version=0.1.0-preview.51&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=NickSoftware.Switchboard.Analyzers&version=0.1.0-preview.51&prerelease
                    
Install as a Cake Tool

Switchboard Analyzers

Roslyn analyzers and code fixes for the Switchboard Amazon Connect framework. Provides compile-time validation to catch errors before deployment.

NuGet

⚠️ PREVIEW RELEASE: Part of the Switchboard preview release. APIs may change.

Overview

This package provides Roslyn analyzers that validate your Amazon Connect contact flows at compile time, catching common errors before deployment:

  • Missing required flow components
  • Invalid transitions between actions
  • Empty or misconfigured prompts
  • Circular references in flow logic
  • Duplicate action identifiers

Installation

dotnet add package NickSoftware.Switchboard.Analyzers --prerelease

This package is typically installed alongside the main Switchboard package:

dotnet add package NickSoftware.Switchboard --prerelease
dotnet add package NickSoftware.Switchboard.Analyzers --prerelease

Diagnostics

Code Severity Description
SWB001 Error Flow must have at least one action
SWB002 Warning Flow should end with a terminal action (Disconnect or TransferToQueue)
SWB003 Error All transitions must point to valid action identifiers
SWB004 Error Flow name must be set before building
SWB005 Error Queue name cannot be empty or whitespace
SWB006 Error Prompt text is required
SWB007 Error Lambda function ARN is required
SWB008 Error Hours of operation name cannot be empty
SWB009 Error Circular reference detected in flow logic
SWB010 Error Action identifier must be unique within the flow

Example

The analyzer catches issues like this at compile time:

// ❌ SWB001: Flow must have at least one action
var flow = new FlowBuilder()
    .SetName("EmptyFlow")
    .Build();

// ❌ SWB006: Prompt text is required
var flow = new FlowBuilder()
    .SetName("InvalidFlow")
    .PlayPrompt("")  // Empty prompt text
    .Build();

// ✅ Valid flow
var flow = new FlowBuilder()
    .SetName("ValidFlow")
    .PlayPrompt("Welcome to our service")
    .TransferToQueue("Support")
    .Build();

Code Fixes

The analyzers include automatic code fixes for common issues:

  • Add missing terminal actions
  • Fix empty prompt text
  • Generate unique action identifiers

Configuration

Analyzers can be configured in your .editorconfig:

# Treat SWB002 as an error instead of warning
dotnet_diagnostic.SWB002.severity = error

# Disable SWB010 (duplicate identifier check)
dotnet_diagnostic.SWB010.severity = none

Requirements

  • .NET Standard 2.0 compatible
  • Works with Visual Studio 2022, VS Code, and JetBrains Rider

Documentation


Part of the Switchboard framework for Amazon Connect

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

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.1.0-preview.68 26 5/5/2026
0.1.0-preview.62 39 3/26/2026
0.1.0-preview.61 40 3/25/2026
0.1.0-preview.60 36 3/20/2026
0.1.0-preview.59 32 3/8/2026
0.1.0-preview.58 40 3/7/2026
0.1.0-preview.56 41 1/25/2026
0.1.0-preview.55 46 1/25/2026
0.1.0-preview.54 41 1/25/2026
0.1.0-preview.53 41 1/25/2026
0.1.0-preview.52 69 12/3/2025
0.1.0-preview.51 54 12/2/2025
0.1.0-preview.48 61 12/2/2025
0.1.0-preview.47 62 12/1/2025
0.1.0-preview.46 66 12/1/2025
0.1.0-preview.45 71 11/30/2025
0.1.0-preview.44 66 11/30/2025
0.1.0-preview.43 70 11/30/2025
0.1.0-preview.42 66 11/30/2025
0.1.0-preview.41 64 11/30/2025
Loading failed

Preview release - APIs may change. See documentation at https://nicksoftware.github.io/switchboard-docs/