Soenneker.MsTeams.Util 11.0.1387

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

Soenneker.MsTeams.Util

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Builds Adaptive Cards for common notifications and either sends them directly to Teams or places a MsTeamsMessage on Service Bus.

Installation

dotnet add package Soenneker.MsTeams.Util

Configuration

{
  "Environment": "Local",
  "MsTeams": {
    "UseQueue": false,
    "Enabled": true,
    "Errors": {
      "Enabled": true,
      "WebhookUrl": "https://example.webhook.office.com/webhookb2/..."
    }
  }
}

Each channel needs an Enabled setting. Direct sending also needs the sender's global MsTeams:Enabled switch and an absolute HTTPS WebhookUrl. Channel names cannot contain :. Keep webhook URLs in a secret provider.

MsTeams:UseQueue and per-channel Enabled values respond to configuration reloads. Environment is read when the utility is constructed; skipLocal suppresses a send only when that value is Local.

Registration

using Soenneker.MsTeams.Util.Registrars;

builder.Services.AddMsTeamsUtilAsScoped();
// or: builder.Services.AddMsTeamsUtilAsSingleton();

The scoped registration keeps the Teams sender and its underlying HTTP client infrastructure singleton while allowing the higher-level utility and its other scoped dependencies to be disposed with the scope.

Send a notification

using Soenneker.MsTeams.Util.Abstract;

await teams.SendMessage(
    title: "Import completed",
    channel: "Errors",
    summary: "Customer import finished with warnings",
    facts: new Dictionary<string, string?>
    {
        ["Imported"] = importedCount.ToString(),
        ["Rejected"] = rejectedCount.ToString()
    },
    skipLocal: true,
    cancellationToken: cancellationToken);

The exception overload defaults to the Errors channel and the title Exception thrown. SendMessage<T> builds a table from a list, while SendMessageCard accepts an already-built AdaptiveCard.

When UseQueue is false, successful completion means the Teams webhook accepted the card; a rejected send throws InvalidOperationException. When UseQueue is true, successful completion means Service Bus accepted the message, not that Teams delivered it. Disabled channels and skipLocal return without sending.

Exception details, facts, table values, summaries, and additional body text become card content. Remove credentials and personal data before calling these APIs, and account for duplicate notifications if queue delivery is retried.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Soenneker.MsTeams.Util:

Package Downloads
Soenneker.Alerter.Util

A utility library for alert related operations and abstraction over other notification services

Soenneker.Coordinators.Alerts

Handling Azure alerts from the controller

Soenneker.Runners.Runner

An abstract task runner with methods that typically are executed on some type of schedule.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.1387 277 11/19/2026
11.0.1386 156 11/19/2026
11.0.1385 109 11/19/2026
11.0.1384 128 11/19/2026
11.0.1383 112 11/19/2026
11.0.1382 90 11/19/2026
11.0.1379 113 11/18/2026
11.0.1377 125 11/18/2026
11.0.1375 104 11/18/2026
11.0.1372 161 11/18/2026
11.0.1371 178 11/15/2026
11.0.1370 110 11/15/2026
11.0.1369 130 11/15/2026
11.0.1368 134 11/15/2026
11.0.1367 146 11/15/2026
11.0.1366 116 11/15/2026
11.0.1364 134 11/14/2026
11.0.1363 219 11/12/2026
11.0.1362 158 11/12/2026
11.0.1361 155 11/11/2026
Loading failed

Updated Soenneker.ServiceBus.Transmitter to 11.0.4058